diff options
author | Simon Marlow <marlowsd@gmail.com> | 2008-09-19 10:26:01 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2008-09-19 10:26:01 +0000 |
commit | 8f52645bd99ee3e636a34826c0cbfc5939920da1 (patch) | |
tree | a1664a93c679eed383facbbcba26334ddfe398c4 /rts/Threads.c | |
parent | 09bb1eb4d782fd67c36145fd230bcb201d1548ba (diff) | |
download | haskell-8f52645bd99ee3e636a34826c0cbfc5939920da1.tar.gz |
Move the context_switch flag into the Capability
Fixes a long-standing bug that could in some cases cause sub-optimal
scheduling behaviour.
Diffstat (limited to 'rts/Threads.c')
-rw-r--r-- | rts/Threads.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/rts/Threads.c b/rts/Threads.c index a9d4a721d3..65eaf8dc04 100644 --- a/rts/Threads.c +++ b/rts/Threads.c @@ -507,14 +507,14 @@ unblockOne_ (Capability *cap, StgTSO *tso, 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 = 1; + cap->context_switch = 1; } else { // we'll try to wake it up on the Capability it was last on. wakeupThreadOnCapability(cap, tso->cap, tso); } #else appendToRunQueue(cap,tso); - context_switch = 1; + cap->context_switch = 1; #endif debugTrace(DEBUG_sched, |