summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Williams <samuel.williams@oriontransfer.co.nz>2021-02-12 14:40:50 +1300
committerSamuel Williams <samuel.williams@oriontransfer.co.nz>2021-03-30 18:38:42 +1300
commit09c865d541472366550804ef09bf14e22a193644 (patch)
tree5b4c8f0071fc50ab0d3e7c258f048c4f429fe1e8
parent67f60ebb6494ca6d67d8797625b9c3af9b4135f5 (diff)
Fix native implementation.
# Conflicts: # scheduler.c
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4173
-rw-r--r--include/ruby/fiber/scheduler.h3
-rw-r--r--scheduler.c13
2 files changed, 13 insertions, 3 deletions
diff --git a/include/ruby/fiber/scheduler.h b/include/ruby/fiber/scheduler.h
index 213a8b8..4979880 100644
--- a/include/ruby/fiber/scheduler.h
+++ b/include/ruby/fiber/scheduler.h
@@ -22,7 +22,8 @@ VALUE rb_fiber_scheduler_make_timeout(struct timeval *timeout);
VALUE rb_fiber_scheduler_close(VALUE scheduler);
-VALUE rb_fiber_scheduler_timeout_raise(VALUE scheduler, VALUE duration);
+VALUE rb_fiber_scheduler_timeout_raise(VALUE scheduler, VALUE timeout, VALUE exception, VALUE message);
+VALUE rb_fiber_scheduler_timeout_raisev(VALUE scheduler, int argc, VALUE * argv);
VALUE rb_fiber_scheduler_kernel_sleep(VALUE scheduler, VALUE duration);
VALUE rb_fiber_scheduler_kernel_sleepv(VALUE scheduler, int argc, VALUE * argv);
diff --git a/scheduler.c b/scheduler.c
index a3de613..49fb6e1 100644
--- a/scheduler.c
+++ b/scheduler.c
@@ -110,10 +110,19 @@ rb_fiber_scheduler_make_timeout(struct timeval *timeout)
return Qnil;
}
+VALUE rb_fiber_scheduler_timeout_raise(VALUE scheduler, VALUE timeout, VALUE exception, VALUE message)
+{
+ VALUE arguments[] = {
+ timeout, exception, message
+ };
+
+ return rb_check_funcall(scheduler, id_timeout_raise, 3, arguments);
+}
+
VALUE
-rb_fiber_scheduler_timeout_raise(VALUE scheduler, VALUE timeout)
+rb_fiber_scheduler_timeout_raisev(VALUE scheduler, int argc, VALUE * argv)
{
- return rb_check_funcall(scheduler, id_timeout_raise, 1, &timeout);
+ return rb_check_funcall(scheduler, id_timeout_raise, argc, argv);
}
VALUE