next_wait(nonblock = nil) -> Thread[permalink][rdoc]指定したスレッドのどれかが終了するまで待ちます。
#使用例
require 'thwait'
threads = []
2.times {|i|
threads << Thread.new { sleep i }
}
thall = ThreadsWait.new
thall.join_nowait(*threads)
until thall.empty?
th = thall.next_wait
p th
end
[SEE_ALSO] Queue#pop