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

test/ruby/test_io.rb (test_select_leak): use handle_interrupt

Interrupt timing is tricky and it's possible the target
thread is still stopped from the previous loop iteration.

[ruby-core:88732] [Bug #15043]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
normal 2018-08-29 19:47:14 +00:00
parent ac543abe91
commit f1119509e6

View file

@ -3839,11 +3839,13 @@ __END__
Thread.new { IO.select(rset, wset, nil, 0) }.join
end;
th = Thread.new do
begin
IO.select(rset, wset)
rescue
retry
end while true
Thread.handle_interrupt(StandardError => :on_blocking) do
begin
IO.select(rset, wset)
rescue
retry
end while true
end
end
50_000.times do
Thread.pass until th.stop?