Ruby 2.2.0 リファレンスマニュアル > ライブラリ一覧 > thwaitライブラリ > ThreadsWaitクラス > finished?
finished? -> bool[permalink][rdoc]すでに終了したスレッドが存在すれば true を返します。
使用例
require 'thwait'
threads = []
3.times {|i|
threads << Thread.new { sleep 1; p Thread.current }
}
thall = ThreadsWait.new(*threads)
p thall.finished? #=> false
sleep 3
p thall.finished? #=> true