Skip to content

Commit

Permalink
thread may leak if assert fails before join is finished
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nurse committed Oct 28, 2015
1 parent 1dcd94d commit 875b7d9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/ruby/test_thread.rb
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ def test_handle_interrupt_blocking
th = Thread.start{
Thread.handle_interrupt(Object => :on_blocking){
begin
sleep 0.0001 until r == :wait
Thread.pass until r == :wait
Thread.current.raise RuntimeError
r = :ok
sleep
Expand All @@ -647,8 +647,9 @@ def test_handle_interrupt_blocking
}
}
assert_raise(e) {r = :wait; sleep 1}
ensure
assert_raise(RuntimeError) {th.join(0)}
ensure
th.kill
end
assert_equal(:ok,r)
end
Expand Down

0 comments on commit 875b7d9

Please sign in to comment.