18件ヒット
[1-18件を表示]
(0.083秒)
別のキーワード
ライブラリ
-
irb
/ context (12) - thwait (6)
クラス
-
IRB
:: Context (12) - ThreadsWait (6)
検索結果
-
IRB
:: Context # thread -> Thread (21209.0) -
現在のスレッドを返します。
...現在のスレッドを返します。
@see Thread.current... -
ThreadsWait
# next _ wait(nonblock = nil) -> Thread (9208.0) -
指定したスレッドのどれかが終了するまで待ちます。
...外 ThreadsWait::ErrNoFinishedThread が発生します。
@raise ErrNoWaitingThread 終了をまつスレッドが存在しない時、発生します。
@raise ErrNoFinishedThread nonblock がtrue でかつ、キューが空の時、発生します。
#使用例
require 'thwait'
threads......= []
2.times {|i|
threads << Thread.new { sleep i }
}
thall = ThreadsWait.new
thall.join_nowait(*threads)
until thall.empty?
th = thall.next_wait
p th
end
@see Queue#pop...