aboutsummaryrefslogtreecommitdiffstats
path: root/cont.c
diff options
context:
space:
mode:
authorDelton Ding <dsh0416@gmail.com>2020-12-22 15:30:59 +0900
committerKoichi Sasada <ko1@atdot.net>2020-12-23 03:27:14 +0900
commitc6d7e02b90f96d9bcd04edd48b7374f31c510b2a (patch)
tree294b80840d1c00a9f9117f1608cc8abd7599f6ba /cont.c
parent487355873ad0de9ab70611d63d97f3fbbfebe79d (diff)
downloadruby-c6d7e02b90f96d9bcd04edd48b7374f31c510b2a.tar.gz
Enable `Fiber.current` and `Fiber#alive?` call inside ractor
Diffstat (limited to 'cont.c')
-rw-r--r--cont.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/cont.c b/cont.c
index 123ca33f36..4a9e75759a 100644
--- a/cont.c
+++ b/cont.c
@@ -2744,6 +2744,9 @@ ruby_Init_Continuation_body(void)
void
ruby_Init_Fiber_as_Coroutine(void)
{
+#ifdef HAVE_RB_EXT_RACTOR_SAFE
+ rb_ext_ractor_safe(true);
+#endif
rb_define_method(rb_cFiber, "transfer", rb_fiber_m_transfer, -1);
rb_define_method(rb_cFiber, "alive?", rb_fiber_alive_p, 0);
rb_define_singleton_method(rb_cFiber, "current", rb_fiber_s_current, 0);