From d91ade3e1e8e137d186a00158fb795e9c9ef99e5 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 12 Mar 2021 18:15:56 +0900 Subject: [PATCH] Renamed functions for Fiber singleton methods --- cont.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/cont.c b/cont.c index e02942681a..31f60d852f 100644 --- a/cont.c +++ b/cont.c @@ -1904,7 +1904,7 @@ rb_fiber_new(rb_block_call_func_t func, VALUE obj) } static VALUE -rb_f_fiber_kw(int argc, VALUE* argv, int kw_splat) +rb_fiber_s_schedule_kw(int argc, VALUE* argv, int kw_splat) { rb_thread_t * th = GET_THREAD(); VALUE scheduler = th->scheduler; @@ -1962,9 +1962,9 @@ rb_f_fiber_kw(int argc, VALUE* argv, int kw_splat) * */ static VALUE -rb_f_fiber(int argc, VALUE *argv, VALUE obj) +rb_fiber_s_schedule(int argc, VALUE *argv, VALUE obj) { - return rb_f_fiber_kw(argc, argv, rb_keyword_given_p()); + return rb_fiber_s_schedule_kw(argc, argv, rb_keyword_given_p()); } /* @@ -1978,7 +1978,7 @@ rb_f_fiber(int argc, VALUE *argv, VALUE obj) * */ static VALUE -rb_fiber_scheduler(VALUE klass) +rb_fiber_s_scheduler(VALUE klass) { return rb_fiber_scheduler_get(); } @@ -2344,7 +2344,7 @@ rb_fiber_blocking_p(VALUE fiber) * */ static VALUE -rb_f_fiber_blocking_p(VALUE klass) +rb_fiber_s_blocking_p(VALUE klass) { rb_thread_t *thread = GET_THREAD(); unsigned blocking = thread->blocking; @@ -3074,12 +3074,11 @@ Init_Cont(void) 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, "blocking?", rb_f_fiber_blocking_p, 0); - rb_define_singleton_method(rb_cFiber, "scheduler", rb_fiber_scheduler, 0); + rb_define_singleton_method(rb_cFiber, "blocking?", rb_fiber_s_blocking_p, 0); + rb_define_singleton_method(rb_cFiber, "scheduler", rb_fiber_s_scheduler, 0); rb_define_singleton_method(rb_cFiber, "set_scheduler", rb_fiber_set_scheduler, 1); - rb_define_singleton_method(rb_cFiber, "schedule", rb_f_fiber, -1); - //rb_define_global_function("Fiber", rb_f_fiber, -1); + rb_define_singleton_method(rb_cFiber, "schedule", rb_fiber_s_schedule, -1); #if 0 /* for RDoc */ rb_cFiberScheduler = rb_define_class_under(rb_cFiber, "SchedulerInterface", rb_cObject);