X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FThreads.c;h=3b209ea95b51ccc5b86c795be574f5b835153456;hb=f65bf7559b3e92607cfcf7a334e9994891dd9c32;hp=28820c8d440e8e1d59cb2daec2d180e6e674889c;hpb=a2a67cd520b9841114d69a87a423dabcb3b4368e;p=ghc-hetmet.git diff --git a/rts/Threads.c b/rts/Threads.c index 28820c8..3b209ea 100644 --- a/rts/Threads.c +++ b/rts/Threads.c @@ -75,7 +75,8 @@ createThread(Capability *cap, nat size) tso->why_blocked = NotBlocked; tso->blocked_exceptions = END_TSO_QUEUE; - tso->flags = TSO_DIRTY; + tso->flags = 0; + tso->dirty = 1; tso->saved_errno = 0; tso->bound = NULL; @@ -105,11 +106,9 @@ createThread(Capability *cap, nat size) g0s0->threads = tso; RELEASE_LOCK(&sched_mutex); - postEvent (cap, EVENT_CREATE_THREAD, tso->id, 0); + // ToDo: report the stack size in the event? + traceSchedEvent (cap, EVENT_CREATE_THREAD, tso, tso->stack_size); - debugTrace(DEBUG_sched, - "created thread %ld, stack size = %lx words", - (long)tso->id, (long)tso->stack_size); return tso; } @@ -255,10 +254,7 @@ unblockOne_ (Capability *cap, StgTSO *tso, cap->context_switch = 1; #endif - postEvent (cap, EVENT_THREAD_WAKEUP, tso->id, tso->cap->no); - - debugTrace(DEBUG_sched, "waking up thread %ld on cap %d", - (long)tso->id, tso->cap->no); + traceSchedEvent (cap, EVENT_THREAD_WAKEUP, tso, tso->cap->no); return next; } @@ -356,6 +352,7 @@ printThreadBlockage(StgTSO *tso) } } + void printThreadStatus(StgTSO *t) { @@ -377,7 +374,7 @@ printThreadStatus(StgTSO *t) default: printThreadBlockage(t); } - if (t->flags & TSO_DIRTY) { + if (t->dirty) { debugBelch(" (TSO_DIRTY)"); } else if (t->flags & TSO_LINK_DIRTY) { debugBelch(" (TSO_LINK_DIRTY)");