diff options
Diffstat (limited to 'thread.c')
-rw-r--r-- | thread.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -1053,6 +1053,10 @@ thread_join_sleep(VALUE arg) if (scheduler != Qnil) { rb_fiber_scheduler_block(scheduler, target_th->self, p->timeout); + // Check if the target thread is finished after blocking: + if (thread_finished(target_th)) break; + // Otherwise, a timeout occurred: + else return Qfalse; } else if (!limit) { sleep_forever(th, SLEEP_DEADLOCKABLE | SLEEP_ALLOW_SPURIOUS | SLEEP_NO_CHECKINTS); @@ -1070,6 +1074,7 @@ thread_join_sleep(VALUE arg) RUBY_DEBUG_LOG("interrupted target_th:%u status:%s", rb_th_serial(target_th), thread_status_name(target_th, TRUE)); } + return Qtrue; } |