X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FSchedule.c;h=fd84fde490956e4c51f4637720688dea1a365d39;hb=a11bb49b97eaba892730baf1565e922715dbc07f;hp=715517e97686469ed95cadf9d309cced8759345f;hpb=54fe7a440247fbd0f853d07da23d48b50a229a00;p=ghc-hetmet.git diff --git a/rts/Schedule.c b/rts/Schedule.c index 715517e..fd84fde 100644 --- a/rts/Schedule.c +++ b/rts/Schedule.c @@ -550,8 +550,6 @@ schedule (Capability *initialCapability, Task *task) } #endif - cap->r.rCurrentTSO = t; - /* context switches are initiated by the timer signal, unless * the user specified "context switch as often as possible", with * +RTS -C0 @@ -563,6 +561,11 @@ schedule (Capability *initialCapability, Task *task) run_thread: + // CurrentTSO is the thread to run. t might be different if we + // loop back to run_thread, so make sure to set CurrentTSO after + // that. + cap->r.rCurrentTSO = t; + debugTrace(DEBUG_sched, "-->> running thread %ld %s ...", (long)t->id, whatNext_strs[t->what_next]);