4件ヒット
[1-4件を表示]
(0.030秒)
種類
- 特異メソッド (3)
- インスタンスメソッド (1)
ライブラリ
- thwait (4)
検索結果
先頭4件
-
ThreadsWait
. all _ waits(*threads) -> () (54346.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... -
ThreadsWait
. all _ waits(*threads) {|thread| . . . } -> () (54346.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... -
ThreadsWait
# all _ waits -> () (54343.0) -
指定されたスレッドすべてが終了するまで待ちます。 ブロックが与えられた場合、スレッド終了時にブロックを評価します。
...ます。
使用例
require 'thwait'
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... -
ThreadsWait
. new(*threads) -> ThreadsWait (40.0) -
指定されたスレッドの終了をまつための、スレッド同期オブジェクトをつくります。
...ます。
使用例
require 'thwait'
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...