X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FTask.c;h=a5de804418ab2eeefbfc16bcad39e3fbc4a8c540;hb=209e093599d0d4db5487d124895d817c55b7c052;hp=a15758c4f1cdb73f2862306f95d3c75de10fa551;hpb=81e61ece2c8e98c3e42df4fa5074a9dff334bdfc;p=ghc-hetmet.git 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"); }