projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Documentation for -fno-code and -fwrite-iface.
[ghc-hetmet.git]
/
ghc
/
rts
/
Task.c
diff --git
a/ghc/rts/Task.c
b/ghc/rts/Task.c
index
bc140c1
..
7366480
100644
(file)
--- a/
ghc/rts/Task.c
+++ b/
ghc/rts/Task.c
@@
-171,14
+171,25
@@
boundTaskExiting (Task *task)
IF_DEBUG(scheduler,sched_belch("task exiting"));
}
IF_DEBUG(scheduler,sched_belch("task exiting"));
}
+#ifdef THREADED_RTS
+#define TASK_ID(t) (t)->id
+#else
+#define TASK_ID(t) (t)
+#endif
+
void
discardTask (Task *task)
{
ASSERT_LOCK_HELD(&sched_mutex);
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", TASK_ID(task)));
+ task->cap = NULL;
+ task->tso = NULL;
+ task->stopped = rtsTrue;
+ tasksRunning--;
+ task->next = task_free_list;
+ task_free_list = task;
+ }
}
void
}
void