X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FThreads.c;h=936b90e884d184f7e8fe31d6365f54b98d64de68;hb=4e3542263207ae49963811aeb84927027e7bb61d;hp=2c7b2beb8678e8736da7cbbe4d3eb562baff3640;hpb=192c7d555448b8a78d57a5c01c0c20f642f2d0f3;p=ghc-hetmet.git diff --git a/rts/Threads.c b/rts/Threads.c index 2c7b2be..936b90e 100644 --- a/rts/Threads.c +++ b/rts/Threads.c @@ -505,8 +505,10 @@ unblockOne_ (Capability *cap, StgTSO *tso, } tso->cap = cap; appendToRunQueue(cap,tso); - // we're holding a newly woken thread, make sure we context switch - // quickly so we can migrate it if necessary. + + // context-switch soonish so we can migrate the new thread if + // necessary. NB. not contextSwitchCapability(cap), which would + // force a context switch immediately. cap->context_switch = 1; } else { // we'll try to wake it up on the Capability it was last on. @@ -514,6 +516,10 @@ unblockOne_ (Capability *cap, StgTSO *tso, } #else appendToRunQueue(cap,tso); + + // context-switch soonish so we can migrate the new thread if + // necessary. NB. not contextSwitchCapability(cap), which would + // force a context switch immediately. cap->context_switch = 1; #endif