X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FTask.c;h=a5de804418ab2eeefbfc16bcad39e3fbc4a8c540;hb=209e093599d0d4db5487d124895d817c55b7c052;hp=8994ad153e47193c171ce87f032fe2ee760a80b0;hpb=2c3e47bb5dc96ed5e0a17f49f8fe8e0abe986dcc;p=ghc-hetmet.git diff --git a/rts/Task.c b/rts/Task.c index 8994ad1..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"); } @@ -359,6 +365,8 @@ static void *taskId(Task *task) #endif } +#endif + #if defined(THREADED_RTS) static void OSThreadProcAttr @@ -431,6 +439,8 @@ interruptWorkerTask (Task *task) #endif /* THREADED_RTS */ +#ifdef DEBUG + void printAllTasks(void); void