summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authorSamuel Williams <samuel.williams@oriontransfer.co.nz>2020-09-14 11:10:02 +1200
committerSamuel Williams <samuel.williams@oriontransfer.co.nz>2020-09-14 16:44:09 +1200
commit8eea66a0ca8965ae8319b4c404f61c4d46866f64 (patch)
tree6083a6566df682ec5598bb971291cc150877de2b /thread.c
parent0f613cc5f1bbe319ab916be905de263523ef5402 (diff)
Add support for Queue & SizedQueue.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3434
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/thread.c b/thread.c
index c4ff5aafde..ab574e5c29 100644
--- a/thread.c
+++ b/thread.c
@@ -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