Commit fec3bab8 authored by Simon Marlow's avatar Simon Marlow
Browse files

discardTask(): reset task->tso to avoid confusion later

parent 5638488b
...@@ -175,10 +175,15 @@ void ...@@ -175,10 +175,15 @@ void
discardTask (Task *task) discardTask (Task *task)
{ {
ASSERT_LOCK_HELD(&sched_mutex); ASSERT_LOCK_HELD(&sched_mutex);
task->stopped = rtsTrue; if (!task->stopped) {
task->cap = NULL; IF_DEBUG(scheduler,sched_belch("discarding task %p",(void *)task->id));
task->next = task_free_list; task->cap = NULL;
task_free_list = task; task->tso = NULL;
task->stopped = rtsTrue;
tasksRunning--;
task->next = task_free_list;
task_free_list = task;
}
} }
void void
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment