X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=ghc%2Frts%2FCapability.c;h=143eefe432c6660516b808919e31083e99177e68;hb=5638488ba28ec84fbf64bf2742a040e3fa30bed4;hp=8c40b639927b3af1202bdc36d0b130a9ddece7c3;hpb=04089f99f55e719afd0c967be35e8bbb8691dbed;p=ghc-hetmet.git diff --git a/ghc/rts/Capability.c b/ghc/rts/Capability.c index 8c40b63..143eefe 100644 --- a/ghc/rts/Capability.c +++ b/ghc/rts/Capability.c @@ -44,7 +44,7 @@ STATIC_INLINE rtsBool globalWorkToDo (void) { return blackholes_need_checking - || interrupted + || sched_state >= SCHED_INTERRUPTING ; } #endif @@ -286,7 +286,7 @@ releaseCapability_ (Capability* cap) // is interrupted, we only create a worker task if there // are threads that need to be completed. If the system is // shutting down, we never create a new worker. - if (!shutting_down_scheduler) { + if (sched_state < SCHED_SHUTTING_DOWN || !emptyRunQueue(cap)) { IF_DEBUG(scheduler, sched_belch("starting new worker on capability %d", cap->no)); startWorkerTask(cap, workerStart); @@ -575,7 +575,7 @@ shutdownCapability (Capability *cap, Task *task) { nat i; - ASSERT(interrupted && shutting_down_scheduler); + ASSERT(sched_state == SCHED_SHUTTING_DOWN); task->cap = cap;