diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-06-06 18:19:42 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-06-06 18:19:42 +0000 |
commit | d80e7373cfb0ca1558bdeb79643c53db5f9ce4d8 (patch) | |
tree | a0f9bd31081dda1430be6d7df5649515832c8835 /test | |
parent | ed8897523701745467cf831ff19ec3268856cf6e (diff) | |
download | bundler-d80e7373cfb0ca1558bdeb79643c53db5f9ce4d8.tar.gz |
* cont.c (cont_new): add debug message.
* cont.c (cont_restore_1): copy stack information from fiber.
* cont.c (rb_fiber_s_new): fix to mark created fiber.
* test/ruby/test_fiber.rb: add some tests around Thread and Fiber.
* yarvcore.c (thread_free): fix to skip freeing stack if root fiber
is available.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_fiber.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/ruby/test_fiber.rb b/test/ruby/test_fiber.rb index 97ec09c36b..44caba4520 100644 --- a/test/ruby/test_fiber.rb +++ b/test/ruby/test_fiber.rb @@ -40,6 +40,23 @@ class TestFiber < Test::Unit::TestCase ) end + def test_many_fibers_with_threads + max = 1000 + @cnt = 0 + (1..100).map{|ti| + Thread.new{ + max.times{|i| + Fiber.new{ + @cnt += 1 + }.yield + } + } + }.each{|t| + t.join + } + assert_equal(:ok, :ok) + end + def test_error assert_raise(ArgumentError){ Fiber.new # Fiber without block |