if (tid == 0)
signal_process_queue();
- if (stopping && tasks_run_queue == 0)
- _HA_ATOMIC_OR(&stopping_thread_mask, tid_bit);
-
- /* stop when there's nothing left to do */
- if ((jobs - unstoppable_jobs) == 0 && tasks_run_queue == 0 &&
- (stopping_thread_mask & all_threads_mask) == all_threads_mask)
- break;
-
/* also stop if we failed to cleanly stop all tasks */
if (killed > 1)
break;
wake = 0;
}
+ if (!wake) {
+ if (stopping)
+ _HA_ATOMIC_OR(&stopping_thread_mask, tid_bit);
+
+ /* stop when there's nothing left to do */
+ if ((jobs - unstoppable_jobs) == 0 &&
+ (stopping_thread_mask & all_threads_mask) == all_threads_mask)
+ break;
+ }
+
/* If we have to sleep, measure how long */
next = wake ? TICK_ETERNITY : next_timer_expiry();