mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Don't use th->scheduler
directly because it's not always valid to do so.
This commit is contained in:
parent
1d3024da26
commit
2db081b5ff
Notes:
git
2020-10-01 17:39:06 +09:00
1 changed files with 4 additions and 2 deletions
6
thread.c
6
thread.c
|
@ -1175,8 +1175,10 @@ thread_join_sleep(VALUE arg)
|
|||
}
|
||||
|
||||
while (target_th->status != THREAD_KILLED) {
|
||||
if (th->scheduler != Qnil) {
|
||||
rb_scheduler_block(th->scheduler, target_th->self, p->timeout);
|
||||
VALUE scheduler = rb_thread_current_scheduler();
|
||||
|
||||
if (scheduler != Qnil) {
|
||||
rb_scheduler_block(scheduler, target_th->self, p->timeout);
|
||||
} else if (!limit) {
|
||||
th->status = THREAD_STOPPED_FOREVER;
|
||||
rb_ractor_sleeper_threads_inc(th->ractor);
|
||||
|
|
Loading…
Reference in a new issue