Ruby 1.9.3 リファレンスマニュアル > ライブラリ一覧 > thwaitライブラリ > ThreadsWaitクラス > next_wait
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