projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5638488
)
discardTask(): reset task->tso to avoid confusion later
author
Simon Marlow
<simonmar@microsoft.com>
Thu, 16 Mar 2006 12:52:56 +0000
(12:52 +0000)
committer
Simon Marlow
<simonmar@microsoft.com>
Thu, 16 Mar 2006 12:52:56 +0000
(12:52 +0000)
ghc/rts/Task.c
patch
|
blob
|
history
diff --git
a/ghc/rts/Task.c
b/ghc/rts/Task.c
index
bc140c1
..
7621d8b
100644
(file)
--- 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