diff options
Diffstat (limited to 'rts/Task.c')
-rw-r--r-- | rts/Task.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/rts/Task.c b/rts/Task.c index 0e51dbf124..551f13777a 100644 --- a/rts/Task.c +++ b/rts/Task.c @@ -68,20 +68,10 @@ initTaskManager (void) void stopTaskManager (void) { - Task *task; - debugTrace(DEBUG_sched, "stopping task manager, %d tasks still running", tasksRunning); - - ACQUIRE_LOCK(&sched_mutex); - for (task = task_free_list; task != NULL; task = task->next) { -#if defined(THREADED_RTS) - closeCondition(&task->cond); - closeMutex(&task->lock); -#endif - } - RELEASE_LOCK(&sched_mutex); + /* nothing to do */ } @@ -94,6 +84,10 @@ freeTaskManager (void) ACQUIRE_LOCK(&sched_mutex); for (task = task_free_list; task != NULL; task = next) { +#if defined(THREADED_RTS) + closeCondition(&task->cond); + closeMutex(&task->lock); +#endif next = task->next; stgFree(task); } |