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

instance method ThreadsWait#join_nowait

join_nowait(*threads) -> ()

終了を待つスレッドの対象として、threads で指定されたスレッドを指定します。 しかし、実際には終了をまちません。

[PARAM] threads:
複数スレッドの終了を待つスレッドに指定されたthreadsを加えます。
require 'thwait'

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

thall = ThreadsWait.new
p thall.threads #=> []
thall.join_nowait(*threads)
p thall.threads #=> [#<Thread:0x21638 sleep>, #<Thread:0x215ac sleep>, #<Thread:0x21520 sleep>, #<Thread:0x21494 sleep>, #<Thread:0x21408 sleep>]
# 実際には終了を待っていない。sleep している。
class ThreadsWait