diff options
author | Samuel Williams <samuel.williams@oriontransfer.co.nz> | 2021-02-12 14:40:50 +1300 |
---|---|---|
committer | Samuel Williams <samuel.williams@oriontransfer.co.nz> | 2021-03-30 18:38:42 +1300 |
commit | 09c865d541472366550804ef09bf14e22a193644 (patch) | |
tree | 5b4c8f0071fc50ab0d3e7c258f048c4f429fe1e8 | |
parent | 67f60ebb6494ca6d67d8797625b9c3af9b4135f5 (diff) | |
download | ruby-09c865d541472366550804ef09bf14e22a193644.tar.gz |
Fix native implementation.
# Conflicts:
# scheduler.c
-rw-r--r-- | include/ruby/fiber/scheduler.h | 3 | ||||
-rw-r--r-- | scheduler.c | 13 |
2 files changed, 13 insertions, 3 deletions
diff --git a/include/ruby/fiber/scheduler.h b/include/ruby/fiber/scheduler.h index 213a8b8a1f..4979880d9c 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 a3de6131f0..49fb6e1408 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 |