Feature #4326 » fiber.patch
cont.c | ||
---|---|---|
rb_define_singleton_method(rb_cFiber, "yield", rb_fiber_s_yield, -1);
|
||
rb_define_method(rb_cFiber, "initialize", rb_fiber_init, 0);
|
||
rb_define_method(rb_cFiber, "resume", rb_fiber_m_resume, -1);
|
||
rb_define_method(rb_cFiber, "call", rb_fiber_m_resume, -1);
|
||
}
|
||
#if defined __GNUC__ && __GNUC__ >= 4
|
test/ruby/test_fiber.rb | ||
---|---|---|
require_relative './envutil'
|
||
class TestFiber < Test::Unit::TestCase
|
||
def test_call
|
||
Fiber.new { |e| assert_equal(:ok1, e) }.call(:ok1)
|
||
end
|
||
def test_normal
|
||
f = Fiber.current
|
||
assert_equal(:ok2,
|
- « Previous
- 1
- 2
- Next »