るりまサーチ

最速Rubyリファレンスマニュアル検索!
6件ヒット [1-6件を表示] (0.143秒)

別のキーワード

  1. drb thread
  2. thread exit
  3. thread join
  4. thread kill
  5. etc sc_thread_keys_max

ライブラリ

クラス

検索結果

ThreadsWait#next_wait(nonblock = nil) -> Thread (21221.0)

指定したスレッドのどれかが終了するまで待ちます。

...まで待ちます。

@param nonblock true を与えると、キューが空の時、例外 ThreadsWait::ErrNoFinishedThread が発生します。

@raise ErrNoWaitingThread 終了をまつスレッドが存在しない時、発生します。

@raise ErrNoFinishedThread nonblock がtrue でかつ...
...、キューが空の時、発生します。

#使用例
require 'thwait'

thread
s = []
2.times {|i|
thread
s << Thread.new { sleep i }
}

thall = ThreadsWait.new
thall.join_nowait(*threads)
until thall.empty?
th = thall.next_wait
p
th
end

@see Queue#pop...