1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Terminate created threads.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2017-04-13 16:19:46 +00:00
parent f8bb720eb7
commit 4032f45dc2
2 changed files with 4 additions and 1 deletions

View file

@ -162,7 +162,7 @@ module Net
servers = Socket.tcp_server_sockets("localhost", 0)
begin
sock = nil
Thread.start do
t = Thread.start do
sock = accept(servers)
sock.close
end
@ -176,6 +176,7 @@ module Net
ensure
sock.close if sock
servers.each(&:close)
t.join
end
end

View file

@ -727,6 +727,8 @@ end.join
end
end
assert_nil(e.cause)
ensure
y.join
end
def test_cause_thread_with_cause