summaryrefslogtreecommitdiff
path: root/rts/Task.c
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2006-12-15 17:26:17 +0000
committerIan Lynagh <igloo@earth.li>2006-12-15 17:26:17 +0000
commit1f801e3abd16559f2120b7f482b19deb0c43a0c7 (patch)
treec4934d3cc314cf15e303edcc8e43acb6ec911b80 /rts/Task.c
parent48aefd90f74b4c9522eacdf9a730e50a1dfa29f9 (diff)
downloadhaskell-1f801e3abd16559f2120b7f482b19deb0c43a0c7.tar.gz
Free all tasks on exit, not just those on the task_free_list
Diffstat (limited to 'rts/Task.c')
-rw-r--r--rts/Task.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/rts/Task.c b/rts/Task.c
index 9aa43c08c2..4a630843b7 100644
--- a/rts/Task.c
+++ b/rts/Task.c
@@ -83,14 +83,15 @@ freeTaskManager (void)
debugTrace(DEBUG_sched, "freeing task manager");
ACQUIRE_LOCK(&sched_mutex);
- for (task = task_free_list; task != NULL; task = next) {
+ for (task = all_tasks; task != NULL; task = next) {
#if defined(THREADED_RTS)
closeCondition(&task->cond);
closeMutex(&task->lock);
#endif
- next = task->next;
+ next = task->all_link;
stgFree(task);
}
+ all_tasks = NULL;
task_free_list = NULL;
RELEASE_LOCK(&sched_mutex);
}