globalWorkToDo (void)
{
return blackholes_need_checking
- || interrupted
+ || sched_state >= SCHED_INTERRUPTING
;
}
#endif
// 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);
{
nat i;
- ASSERT(interrupted && shutting_down_scheduler);
+ ASSERT(sched_state == SCHED_SHUTTING_DOWN);
task->cap = cap;