るりまサーチ

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

別のキーワード

  1. _builtin to_r
  2. open3 pipeline_r
  3. matrix elements_to_r
  4. fileutils rm_r
  5. fileutils cp_r

ライブラリ

クラス

検索結果

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

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

...待ちます。

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

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

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

#使用例
r
equire 'thwait'

t
hreads = []
2.times {|i|
t
hreads << Thread.new { sleep i }
}

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

@see Queue#pop...