diff options
Diffstat (limited to 'scheduler.c')
-rw-r--r-- | scheduler.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/scheduler.c b/scheduler.c index 9f68feef9d..b57d38e4b4 100644 --- a/scheduler.c +++ b/scheduler.c @@ -422,6 +422,13 @@ rb_fiber_scheduler_unblock(VALUE scheduler, VALUE blocker, VALUE fiber) // If we explicitly preserve `errno` in `io_binwrite` and other similar functions (e.g. by returning it), this code is no longer needed. I hope in the future we will be able to remove it. int saved_errno = errno; +#ifdef RUBY_DEBUG + rb_execution_context_t *ec = GET_EC(); + if (ec->interrupt_flag) { + rb_bug("rb_fiber_scheduler_unblock called with interrupt flags set"); + } +#endif + VALUE result = rb_funcall(scheduler, id_unblock, 2, blocker, fiber); errno = saved_errno; @@ -853,6 +860,13 @@ VALUE rb_fiber_scheduler_fiber_interrupt(VALUE scheduler, VALUE fiber, VALUE exc fiber, exception }; +#ifdef RUBY_DEBUG + rb_execution_context_t *ec = GET_EC(); + if (ec->interrupt_flag) { + rb_bug("rb_fiber_scheduler_fiber_interrupt called with interrupt flags set"); + } +#endif + return rb_check_funcall(scheduler, id_fiber_interrupt, 2, arguments); } |