don't yield the Capability if blackholes_need_checking
authorSimon Marlow <marlowsd@gmail.com>
Wed, 5 Nov 2008 15:49:28 +0000 (15:49 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Wed, 5 Nov 2008 15:49:28 +0000 (15:49 +0000)
rts/Schedule.c

index 569c3d0..ca6e426 100644 (file)
@@ -714,7 +714,8 @@ scheduleYield (Capability **pcap, Task *task)
     Capability *cap = *pcap;
 
     // if we have work, and we don't need to give up the Capability, continue.
-    if (!emptyRunQueue(cap) && !shouldYieldCapability(cap,task))
+    if (!shouldYieldCapability(cap,task) && 
+        (!emptyRunQueue(cap) || blackholes_need_checking))
         return;
 
     // otherwise yield (sleep), and keep yielding if necessary.