るりまサーチ

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

別のキーワード

  1. _builtin inspect
  2. csv inspect
  3. inspect _builtin
  4. matrix inspect
  5. set inspect

ライブラリ

キーワード

検索結果

ThreadsWait#all_waits -> () (7.0)

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

...wait'

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

thall = ThreadsWait.new(*threads)
thall.all_waits{|th|
printf("end %s\n", th.inspect)
}

# 出力例
#=> #<Thread:0x214bc run>
#=> #<Thread:0x21548 run>
#=> #<Thread:0x215d4 run>...

ThreadsWait.all_waits(*threads) -> () (7.0)

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

...

require 'thwait'

threads = []
5.times {|i|
threads << Thread.new { sleep 1; p Thread.current }
}
ThreadsWait
.all_waits(*threads) {|th| printf("end %s\n", th.inspect) }

# 出力例
#=> #<Thread:0x21584 run>
#=> #<Thread:0x21610 run>
#=> #<Thread:0x2169c run>
#=> #<Threa...

ThreadsWait.all_waits(*threads) {|thread| ...} -> () (7.0)

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

...

require 'thwait'

threads = []
5.times {|i|
threads << Thread.new { sleep 1; p Thread.current }
}
ThreadsWait
.all_waits(*threads) {|th| printf("end %s\n", th.inspect) }

# 出力例
#=> #<Thread:0x21584 run>
#=> #<Thread:0x21610 run>
#=> #<Thread:0x2169c run>
#=> #<Threa...

ThreadsWait.new(*threads) -> ThreadsWait (7.0)

指定されたスレッドの終了をまつための、スレッド同期オブジェクトをつくります。

...wait'

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

thall = ThreadsWait.new(*threads)
thall.all_waits{|th|
printf("end %s\n", th.inspect)
}

# 出力例
#=> #<Thread:0x214bc run>
#=> #<Thread:0x21548 run>
#=> #<Thread:0x215d4 run>...