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:
Alan Wu 2024-12-09 15:48:39 -05:00
parent 476d655053
commit 0c9c6efc20
Notes: git 2024-12-09 21:20:20 +00:00

View File

@ -1200,9 +1200,11 @@ rb_process_status_wait(rb_pid_t pid, int flags)
// We only enter the scheduler if we are "blocking":
if (!(flags & WNOHANG)) {
VALUE scheduler = rb_fiber_scheduler_current();
if (scheduler != Qnil) {
VALUE result = rb_fiber_scheduler_process_wait(scheduler, pid, flags);
if (!UNDEF_P(result)) return result;
}
}
struct waitpid_state waitpid_state;