るりまサーチ

最速Rubyリファレンスマニュアル検索!
6件ヒット [1-6件を表示] (0.015秒)
トップページ > クラス:ThreadsWait[x] > クエリ:thread[x] > クエリ:raise[x]

別のキーワード

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

ライブラリ

検索結果

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

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

... 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...