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) {
|
while (target_th->status != THREAD_KILLED) {
|
||||||
if (th->scheduler != Qnil) {
|
VALUE scheduler = rb_thread_current_scheduler();
|
||||||
rb_scheduler_block(th->scheduler, target_th->self, p->timeout);
|
|
||||||
|
if (scheduler != Qnil) {
|
||||||
|
rb_scheduler_block(scheduler, target_th->self, p->timeout);
|
||||||
} else if (!limit) {
|
} else if (!limit) {
|
||||||
th->status = THREAD_STOPPED_FOREVER;
|
th->status = THREAD_STOPPED_FOREVER;
|
||||||
rb_ractor_sleeper_threads_inc(th->ractor);
|
rb_ractor_sleeper_threads_inc(th->ractor);
|
||||||
|
|
Loading…
Reference in a new issue