mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* bootstraptest/test_thread.rb: propagate the exception within a thread to
outer. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c796b348c6
commit
f6fbdf261e
1 changed files with 6 additions and 1 deletions
|
@ -393,9 +393,14 @@ assert_equal 'ok', %{
|
||||||
m = Mutex.new
|
m = Mutex.new
|
||||||
Thread.new { m.lock; sleep 1 }
|
Thread.new { m.lock; sleep 1 }
|
||||||
sleep 0.3
|
sleep 0.3
|
||||||
|
parent = Thread.current
|
||||||
Thread.new do
|
Thread.new do
|
||||||
sleep 0.3
|
sleep 0.3
|
||||||
fork { GC.start }
|
begin
|
||||||
|
fork { GC.start }
|
||||||
|
rescue Exception
|
||||||
|
parent.raise $!
|
||||||
|
end
|
||||||
end
|
end
|
||||||
m.lock
|
m.lock
|
||||||
pid, status = Process.wait2
|
pid, status = Process.wait2
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue