[project @ 2005-11-02 13:04:55 by simonmar]
authorsimonmar <unknown>
Wed, 2 Nov 2005 13:04:55 +0000 (13:04 +0000)
committersimonmar <unknown>
Wed, 2 Nov 2005 13:04:55 +0000 (13:04 +0000)
when shutting down, don't allow a worker to exit until the run queue
is empty, because the thread in exitScheduler() is waiting for this.

ghc/rts/Schedule.c

index 15d2181..d8cee87 100644 (file)
@@ -417,7 +417,7 @@ schedule (Capability *initialCapability, Task *task)
            // 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) {
+           if (task->tso == NULL && emptyRunQueue(cap)) {
                return cap;
            }
        } else {