findSpark: exit if there's a returning foreign call
authorSimon Marlow <marlowsd@gmail.com>
Fri, 9 Oct 2009 15:29:20 +0000 (15:29 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Fri, 9 Oct 2009 15:29:20 +0000 (15:29 +0000)
rts/Capability.c

index 8cfcba0..9294949 100644 (file)
@@ -77,7 +77,7 @@ findSpark (Capability *cap)
   rtsBool retry;
   nat i = 0;
 
-  if (!emptyRunQueue(cap)) {
+  if (!emptyRunQueue(cap) || cap->returning_tasks_hd != NULL) {
       // If there are other threads, don't try to run any new
       // sparks: sparks might be speculative, we don't want to take
       // resources away from the main computation.