[project @ 2005-10-26 11:41:51 by simonmar]
authorsimonmar <unknown>
Wed, 26 Oct 2005 11:41:51 +0000 (11:41 +0000)
committersimonmar <unknown>
Wed, 26 Oct 2005 11:41:51 +0000 (11:41 +0000)
fix to previous change: allow workers to exit

ghc/rts/Schedule.c

index fe50cd4..a7696ed 100644 (file)
@@ -408,6 +408,12 @@ schedule (Capability *initialCapability, Task *task)
        deleteRunQueue(cap);
        if (shutting_down_scheduler) {
            IF_DEBUG(scheduler, sched_belch("shutting down"));
+           // If we are a worker, just exit.  If we're a bound thread
+           // then we will exit below when we've removed our TSO from
+           // the run queue.
+           if (task->tso == NULL) {
+               return cap;
+           }
        } else {
            IF_DEBUG(scheduler, sched_belch("interrupted"));
        }