+ /* nothing to do */
+}
+
+
+void
+freeTaskManager (void)
+{
+ Task *task, *next;
+
+ debugTrace(DEBUG_sched, "freeing task manager");
+
+ ACQUIRE_LOCK(&sched_mutex);
+ for (task = all_tasks; task != NULL; task = next) {
+#if defined(THREADED_RTS)
+ closeCondition(&task->cond);
+ closeMutex(&task->lock);
+#endif
+ next = task->all_link;
+ stgFree(task);
+ }
+ all_tasks = NULL;
+ task_free_list = NULL;
+ RELEASE_LOCK(&sched_mutex);