diff options
Diffstat (limited to 'thread.c')
-rw-r--r-- | thread.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -1481,8 +1481,13 @@ rb_thread_sleep_interruptible(void) static void rb_thread_sleep_deadly_allow_spurious_wakeup(void) { - thread_debug("rb_thread_sleep_deadly_allow_spurious_wakeup\n"); - sleep_forever(GET_THREAD(), SLEEP_DEADLOCKABLE); + VALUE scheduler = rb_thread_current_scheduler(); + if (scheduler != Qnil) { + rb_scheduler_kernel_sleepv(scheduler, 0, NULL); + } else { + thread_debug("rb_thread_sleep_deadly_allow_spurious_wakeup\n"); + sleep_forever(GET_THREAD(), SLEEP_DEADLOCKABLE); + } } void |