2件ヒット
[1-2件を表示]
(0.020秒)
クラス
- ThreadsWait (2)
検索結果
-
ThreadsWait
# empty? -> bool (63385.0) -
同期されるスレッドが存在するならば true をかえします。
...同期されるスレッドが存在するならば 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.threa... -
ThreadsWait
# next _ wait(nonblock = nil) -> Thread (9364.0) -
指定したスレッドのどれかが終了するまで待ちます。
...、発生します。
@raise ErrNoFinishedThread nonblock がtrue でかつ、キューが空の時、発生します。
#使用例
require 'thwait'
threads = []
2.times {|i|
threads << Thread.new { sleep i }
}
thall = ThreadsWait.new
thall.join_nowait(*threads)
until thall.e...