-#ifdef RTS_SUPPORTS_THREADS
- /* If another worker thread wants to take over,
- * return to the scheduler
- */
- if (needToYieldToReturningWorker()) {
- return; /* still hold the lock */
- }
-#endif
- RELEASE_LOCK(&sched_mutex);
- } while (wait && !interrupted && run_queue_hd == END_TSO_QUEUE);
-}
+ // Return to the scheduler if:
+ //
+ // - we were interrupted
+ // - new threads have arrived