summaryrefslogtreecommitdiff
path: root/ghc
diff options
context:
space:
mode:
authorSimon Marlow <simonmar@microsoft.com>2006-03-16 12:52:56 +0000
committerSimon Marlow <simonmar@microsoft.com>2006-03-16 12:52:56 +0000
commitfec3bab822c13cf4fa1bc51170fd7ca1fe0d2111 (patch)
tree449cf222b64dc635d8536392761023a621e576cb /ghc
parent5638488ba28ec84fbf64bf2742a040e3fa30bed4 (diff)
downloadhaskell-fec3bab822c13cf4fa1bc51170fd7ca1fe0d2111.tar.gz
discardTask(): reset task->tso to avoid confusion later
Diffstat (limited to 'ghc')
-rw-r--r--ghc/rts/Task.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/ghc/rts/Task.c b/ghc/rts/Task.c
index bc140c1bcb..7621d8b0a7 100644
--- a/ghc/rts/Task.c
+++ b/ghc/rts/Task.c
@@ -175,10 +175,15 @@ void
discardTask (Task *task)
{
ASSERT_LOCK_HELD(&sched_mutex);
- task->stopped = rtsTrue;
- task->cap = NULL;
- task->next = task_free_list;
- task_free_list = task;
+ if (!task->stopped) {
+ IF_DEBUG(scheduler,sched_belch("discarding task %p",(void *)task->id));
+ task->cap = NULL;
+ task->tso = NULL;
+ task->stopped = rtsTrue;
+ tasksRunning--;
+ task->next = task_free_list;
+ task_free_list = task;
+ }
}
void