Use rb_fiber_scheduler_get() instead of rb_fiber_scheduler_current()

rb_fiber_scheduler_current() may return nil depending on whether the
scheduler is being prevented for some reason, e.g., Fiber.blocking{}.

Co-Authored-By: Samuel Williams <samuel.williams@oriontransfer.co.nz>
This commit is contained in:
Yusuke Endoh 2024-11-05 19:18:03 +09:00
parent cb1c79e87b
commit 6c5a808b86
Notes: git 2024-11-05 10:48:18 +00:00

View File

@ -1141,7 +1141,7 @@ rb_vm_bugreport(const void *ctx, FILE *errout)
"---------------------------------------------------\n");
kprintf("Total ractor count: %u\n", vm->ractor.cnt);
kprintf("Ruby thread count for this ractor: %u\n", rb_ec_ractor_ptr(ec)->threads.cnt);
if (rb_fiber_scheduler_current() != Qnil) {
if (rb_fiber_scheduler_get() != Qnil) {
kprintf("Note that the Fiber scheduler is enabled\n");
}
kputs("\n");