Ruby 1.9.3 リファレンスマニュアル > ライブラリ一覧 > thwaitライブラリ > ThreadsWaitクラス > empty?

instance method ThreadsWait#empty?

empty? -> bool

同期されるスレッドが存在するならば true をかえします。

使用例

require 'thwait'

threads = []
3.times {|i|
  threads << Thread.new { sleep 1; p Thread.current }
}

thall = ThreadsWait.new
p thall.threads.empty? #=> true
thall.join(*threads)
p thall.threads.empty? #=> false
class ThreadsWait