From d7a19d03334075e29e14e0e2065d29b73e5d5350 Mon Sep 17 00:00:00 2001 From: ko1 Date: Sun, 12 Aug 2007 20:06:59 +0000 Subject: * thread.c (rb_thread_raise): check if target thread is thrown by another thread or not. [ruby-dev:31371] * bootstraptest/test_thread.rb: add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- bootstraptest/test_thread.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'bootstraptest/test_thread.rb') diff --git a/bootstraptest/test_thread.rb b/bootstraptest/test_thread.rb index 64d685fa19..40ccbad497 100644 --- a/bootstraptest/test_thread.rb +++ b/bootstraptest/test_thread.rb @@ -169,3 +169,17 @@ assert_equal %q{11}, %q{ Thread.current[:a] }.value + Thread.current[:a] } +assert_equal %q{1000}, %q{ +begin + 1000.times do |i| + begin + Thread.start(Thread.current) {|u| u.raise } + raise + rescue + ensure + end + end +rescue + 1000 +end +}, '[ruby-dev:31371]' -- cgit v1.2.3