1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Renamed functions for Fiber singleton methods

This commit is contained in:
Nobuyoshi Nakada 2021-03-12 18:15:56 +09:00
parent 90c12defb3
commit d91ade3e1e
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

17
cont.c
View file

@ -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);