From 48d21c1fbdf9cf032a528e19195714229530a632 Mon Sep 17 00:00:00 2001 From: simonmar Date: Wed, 26 Oct 2005 11:41:51 +0000 Subject: [PATCH] [project @ 2005-10-26 11:41:51 by simonmar] fix to previous change: allow workers to exit --- ghc/rts/Schedule.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ghc/rts/Schedule.c b/ghc/rts/Schedule.c index fe50cd4..a7696ed 100644 --- a/ghc/rts/Schedule.c +++ b/ghc/rts/Schedule.c @@ -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")); } -- 1.7.10.4