Put the task on the free list in workerTaskStop
authorIan Lynagh <igloo@earth.li>
Fri, 15 Dec 2006 16:42:10 +0000 (16:42 +0000)
committerIan Lynagh <igloo@earth.li>
Fri, 15 Dec 2006 16:42:10 +0000 (16:42 +0000)
rts/Task.c

index 551f137..9aa43c0 100644 (file)
@@ -251,6 +251,11 @@ workerTaskStop (Task *task)
     taskTimeStamp(task);
     task->stopped = rtsTrue;
     tasksRunning--;
+
+    ACQUIRE_LOCK(&sched_mutex);
+    task->next = task_free_list;
+    task_free_list = task;
+    RELEASE_LOCK(&sched_mutex);
 }
 
 void