mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* cont.c (rb_fiber_m_yield): added. use this function
for Fiber#yield instead of rb_fiber_yield. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5aa850d260
commit
3efcb087a3
3 changed files with 15 additions and 4 deletions
8
cont.c
8
cont.c
|
@ -630,6 +630,12 @@ rb_fiber_yield(VALUE fib, int argc, VALUE *argv)
|
|||
return value;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rb_fiber_m_yield(int argc, VALUE *argv, VALUE fib)
|
||||
{
|
||||
return rb_fiber_yield(fib, argc, argv);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rb_fiber_prev(VALUE fib)
|
||||
{
|
||||
|
@ -676,7 +682,7 @@ Init_Cont(void)
|
|||
|
||||
rb_cFiber = rb_define_class("Fiber", rb_cObject);
|
||||
rb_undef_alloc_func(rb_cFiber);
|
||||
rb_define_method(rb_cFiber, "yield", rb_fiber_yield, -1);
|
||||
rb_define_method(rb_cFiber, "yield", rb_fiber_m_yield, -1);
|
||||
rb_define_method(rb_cFiber, "prev", rb_fiber_prev, 0);
|
||||
rb_define_method(rb_cFiber, "alive?", rb_fiber_alive_p, 0);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue