るりまサーチ (Ruby 2.5.0)

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

別のキーワード

  1. matrix l
  2. kernel $-l
  3. _builtin $-l
  4. lupdecomposition l

クラス

キーワード

検索結果

ThreadsWait#all_waits -> () (18310.0)

指定されたスレッドすべてが終了するまで待ちます。 ブロックが与えられた場合、スレッド終了時にブロックを評価します。

...するまで待ちます。
ブロックが与えられた場合、スレッド終了時にブロックを評価します。

使用例
require 'thwait'

threads = []
5.times {|i|
threads << Thread.new { sleep 1; p Thread.current }
}

thall = ThreadsWait.new(*threads)
thall.all_wai...

ThreadsWait#empty? -> bool (310.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#finished? -> bool (310.0)

すでに終了したスレッドが存在すれば true を返します。

...すでに終了したスレッドが存在すれば true を返します。

使用例
require 'thwait'

threads = []
3.times {|i|
threads << Thread.new { sleep 1; p Thread.current }
}

thall = ThreadsWait.new(*threads)
p thall.finished? #=> false
sleep 3
p thall.finished? #=> t...

ThreadsWait#next_wait(nonblock = nil) -> Thread (310.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...