126件ヒット
[101-126件を表示]
(0.186秒)
ライブラリ
- ビルトイン (96)
-
irb
/ cmd / subirb (12) - shell (6)
-
shell
/ process-controller (6) -
shell
/ system-command (6)
クラス
-
IRB
:: ExtendCommand :: Kill (12) - Shell (6)
-
Shell
:: ProcessController (6) -
Shell
:: SystemCommand (6) - SignalException (24)
- Thread (72)
検索結果
-
Thread
# value -> object (3007.0) -
スレッド self が終了するまで待ち(Thread#join と同じ)、 そのスレッドのブロックが返した値を返します。スレッド実行中に例外が 発生した場合には、その例外を再発生させます。
...ド self が終了するまで待ち(Thread#join と同じ)、
そのスレッドのブロックが返した値を返します。スレッド実行中に例外が
発生した場合には、その例外を再発生させます。
スレッドが Thread#kill によって終了した場合は、返......終了を待ち結果を出力する例です。
threads = []
threads.push(Thread.new { n = rand(5); sleep n; n })
threads.push(Thread.new { n = rand(5); sleep n; n })
threads.push(Thread.new { n = rand(5); sleep n; n })
threads.each {|t| p t.value}
最後の行で、待ち合わ......せを行っていることがわかりにくいと思うなら以下
のように書くこともできます。
threads.each {|t| p t.join.value}... -
SignalException
# signm -> String (107.0) -
self.message のエイリアスです。
...self.message のエイリアスです。
//emlist[例][ruby]{
begin
Process.kill('HUP', Process.pid)
sleep
rescue SignalException => e
puts e.signm # => SIGHUP
end
//}... -
SignalException
# signo -> Integer (107.0) -
self のシグナル番号を返します。
...self のシグナル番号を返します。
//emlist[例][ruby]{
p Signal.signame(1) # => "HUP"
begin
Process.kill('HUP', Process.pid)
sleep
rescue SignalException => e
p e.signo # => 1
end
//}...