[前][次][番号順一覧][スレッド一覧]

ruby-changes:65701

From: Samuel <ko1@a...>
Date: Tue, 30 Mar 2021 14:38:54 +0900 (JST)
Subject: [ruby-changes:65701] 09c865d541 (master): Fix native implementation.

https://git.ruby-lang.org/ruby.git/commit/?id=09c865d541

From 09c865d541472366550804ef09bf14e22a193644 Mon Sep 17 00:00:00 2001
From: Samuel Williams <samuel.williams@o...>
Date: Fri, 12 Feb 2021 14:40:50 +1300
Subject: Fix native implementation.

# Conflicts:
#	scheduler.c
---
 include/ruby/fiber/scheduler.h |  3 ++-
 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 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); https://github.com/ruby/ruby/blob/trunk/include/ruby/fiber/scheduler.h#L22
 
 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) https://github.com/ruby/ruby/blob/trunk/scheduler.c#L110
     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
-- 
cgit v1.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]