X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=rts%2FTask.c;fp=rts%2FTask.c;h=a5de804418ab2eeefbfc16bcad39e3fbc4a8c540;hp=a15758c4f1cdb73f2862306f95d3c75de10fa551;hb=9201a2d104103c2271a03d035555d2bef8a625bb;hpb=d8334d807812e40f67770ffc37608c0ce66f96b2 diff --git a/rts/Task.c b/rts/Task.c index a15758c..a5de804 100644 --- a/rts/Task.c +++ b/rts/Task.c @@ -270,8 +270,6 @@ newBoundTask (void) void boundTaskExiting (Task *task) { - task->stopped = rtsTrue; - #if defined(THREADED_RTS) ASSERT(osThreadId() == task->id); #endif @@ -279,6 +277,14 @@ boundTaskExiting (Task *task) endInCall(task); + // Set task->stopped, but only if this is the last call (#4850). + // Remember that we might have a worker Task that makes a foreign + // call and then a callback, so it can transform into a bound + // Task for the duration of the callback. + if (task->incall == NULL) { + task->stopped = rtsTrue; + } + debugTrace(DEBUG_sched, "task exiting"); }