Add missing fiber nil check to avoid slow rb_check_funcall()
Check for nil like other callers of rb_fiber_scheduler_current().
This commit is contained in:
parent
476d655053
commit
0c9c6efc20
Notes:
git
2024-12-09 21:20:20 +00:00
@ -1200,9 +1200,11 @@ rb_process_status_wait(rb_pid_t pid, int flags)
|
|||||||
// We only enter the scheduler if we are "blocking":
|
// We only enter the scheduler if we are "blocking":
|
||||||
if (!(flags & WNOHANG)) {
|
if (!(flags & WNOHANG)) {
|
||||||
VALUE scheduler = rb_fiber_scheduler_current();
|
VALUE scheduler = rb_fiber_scheduler_current();
|
||||||
|
if (scheduler != Qnil) {
|
||||||
VALUE result = rb_fiber_scheduler_process_wait(scheduler, pid, flags);
|
VALUE result = rb_fiber_scheduler_process_wait(scheduler, pid, flags);
|
||||||
if (!UNDEF_P(result)) return result;
|
if (!UNDEF_P(result)) return result;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
struct waitpid_state waitpid_state;
|
struct waitpid_state waitpid_state;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user