116件ヒット
[101-116件を表示]
(0.065秒)
別のキーワード
ライブラリ
- ビルトイン (114)
- bigdecimal (2)
クラス
- BigDecimal (2)
- Exception (24)
- SignalException (36)
- Thread (42)
- TracePoint (12)
キーワード
-
abort
_ on _ exception= (12) -
handle
_ interrupt (12) -
report
_ on _ exception (9) -
report
_ on _ exception= (9)
検索結果
-
Thread
. report _ on _ exception -> bool (6133.0) -
真の時は、いずれかのスレッドが例外によって終了した時に、その内容を $stderr に報告します。
...を $stderr に報告します。
デフォルトは true です。
Thread.new { 1.times { raise } }
は $stderr に以下のように出力します:
#<Thread:...> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
2: from -e:1:in `block......in や Thread#value でそのスレッドの終了を待つことが保証できるなら、
スレッド開始時に Thread.current.report_on_exception = false でレポートを無効化しても
安全です。しかし、この場合、例外をハンドルするのが遅れたり、親ス......ことができなかったりするかもしれません。
スレッドごとに設定する方法は Thread#report_on_exception= を参照してください。
@param newstate スレッド実行中に例外発生した場合、その内容を報告するかどうかを true か false で指定... -
Thread
. handle _ interrupt(hash) { . . . } -> object (19.0) -
スレッドの割り込みのタイミングを引数で指定した内容に変更してブロックを 実行します。
...ドをよく理解してから利用してください。
=== 使い方
例:Thread#raise 発生のタイミングを制御する例
th = Thread.new do
Thread.handle_interrupt(RuntimeError => :never) {
begin
# 安全にリソースの割り当てが可能
Thread.handle_......効です。
==== Stack control settings
It's possible to stack multiple levels of ::handle_interrupt blocks in order
to control more than one ExceptionClass and TimingSymbol at a time.
Thread.handle_interrupt(FooError => :never) {
Thread.handle_interrupt(BarError => :never) {
# FooE......ーに指定した例外クラスの全てのサブクラスが
処理の対象になります。
例:
Thread.handle_interrupt(Exception => :never) {
# Exception を継承する全ての例外クラスの例外の発生を延期。
}
@see Thread.pending_interrupt?, Thread#pending_interrup...