6件ヒット
[1-6件を表示]
(0.027秒)
ライブラリ
- thwait (6)
クラス
- ThreadsWait (6)
検索結果
-
ThreadsWait
# all _ waits -> () (18114.0) -
指定されたスレッドすべてが終了するまで待ちます。 ブロックが与えられた場合、スレッド終了時にブロックを評価します。
...[]
5.times {|i|
threads << Thread.new { sleep 1; p Thread.current }
}
thall = ThreadsWait.new(*threads)
thall.all_waits{|th|
printf("end %s\n", th.inspect)
}
# 出力例
#=> #<Thread:0x214bc run>
#=> #<Thread:0x21548 run>
#=> #<Thread:0x215d4 run>
#=> #<Thread:0x21...