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

instance method ThreadsWait#threads

threads -> Array

同期されるスレッドの一覧を配列で返します。

使用例

require 'thwait'

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

thall = ThreadsWait.new(*threads)
p thall.threads
#=> [#<Thread:0x21750 sleep>, #<Thread:0x216c4 sleep>, #<Thread:0x21638 sleep>]
class ThreadsWait