177件ヒット
[101-177件を表示]
(0.271秒)
ライブラリ
- ビルトイン (177)
クラス
- File (11)
- Float (11)
- Integer (11)
- Mutex (2)
- Numeric (11)
- Rational (11)
- Thread (89)
-
Thread
:: Mutex (9) - ThreadGroup (22)
キーワード
- add (11)
-
backtrace
_ locations (22) - inspect (11)
- list (11)
-
report
_ on _ exception (8) -
report
_ on _ exception= (8) - sleep (11)
- status (11)
-
to
_ s (7) - truncate (55)
- wakeup (11)
検索結果
先頭5件
-
Thread
# report _ on _ exception -> bool (8019.0) -
真の場合、そのスレッドが例外によって終了した時に、その内容を $stderr に報告します。
...//emlist[例][ruby]{
a = Thread.new{ Thread.stop; raise }
a.report_on_exception = true
a.report_on_exception # => true
a.run
# => #<Thread:0x00007fc3f48c7908@(irb):1 run> terminated with exception (report_on_exception is true):
# Traceback (most recent call last):
# (irb):1:in `block in ir......b_binding': unhandled exception
# #<Thread:0x00007fc3f48c7908@(irb):1 dead>
b = Thread.new{ Thread.stop; raise }
b.report_on_exception = false
b.run # => #<Thread:0x00007fc3f48aefc0@(irb):4 dead>
//}
@see Thread.report_on_exception... -
Thread
# report _ on _ exception=(newstate) (8019.0) -
真の場合、そのスレッドが例外によって終了した時に、その内容を $stderr に報告します。
...//emlist[例][ruby]{
a = Thread.new{ Thread.stop; raise }
a.report_on_exception = true
a.report_on_exception # => true
a.run
# => #<Thread:0x00007fc3f48c7908@(irb):1 run> terminated with exception (report_on_exception is true):
# Traceback (most recent call last):
# (irb):1:in `block in ir......b_binding': unhandled exception
# #<Thread:0x00007fc3f48c7908@(irb):1 dead>
b = Thread.new{ Thread.stop; raise }
b.report_on_exception = false
b.run # => #<Thread:0x00007fc3f48aefc0@(irb):4 dead>
//}
@see Thread.report_on_exception... -
Mutex
# sleep(timeout = nil) -> Integer (8007.0) -
与えられた秒数の間ロックを解除してスリープして、実行後にまたロックします。
...グナルを受信した場合などに実行が再
開(spurious wakeup)される場合がある点に注意してください。
//emlist[例][ruby]{
m = Mutex.new
th = Thread.new do
m.lock
m.sleep(2)
end
th.status # => "run"
sleep 1
th.status # => "sleep"
sleep 1
th.status # => false
//}... -
Thread
# backtrace _ locations(range) -> [Thread :: Backtrace :: Location] | nil (8007.0) -
スレッドの現在のバックトレースを Thread::Backtrace::Location の配 列で返します。
...似ていますが、本メソッドは self に限定
した情報を返します。
//emlist[例][ruby]{
thread = Thread.new { sleep 1 }
thread.run
thread.backtrace_locations # => ["/path/to/test.rb:1:in `sleep'", "/path/to/test.rb:1:in `block in <main>'"]
//}
@see Thread::Backtrace::Location... -
Thread
# backtrace _ locations(start = 0 , length = nil) -> [Thread :: Backtrace :: Location] | nil (8007.0) -
スレッドの現在のバックトレースを Thread::Backtrace::Location の配 列で返します。
...似ていますが、本メソッドは self に限定
した情報を返します。
//emlist[例][ruby]{
thread = Thread.new { sleep 1 }
thread.run
thread.backtrace_locations # => ["/path/to/test.rb:1:in `sleep'", "/path/to/test.rb:1:in `block in <main>'"]
//}
@see Thread::Backtrace::Location... -
Thread
# inspect -> String (8007.0) -
自身を人間が読める形式に変換した文字列を返します。
...自身を人間が読める形式に変換した文字列を返します。
//emlist[例][ruby]{
a = Thread.current
a.inspect # => "#<Thread:0x00007fdbaf07ddb0 run>"
b = Thread.new{}
b.inspect # => "#<Thread:0x00007fdbaf8f7d10@(irb):3 dead>"
//}... -
Thread
# to _ s -> String (8007.0) -
自身を人間が読める形式に変換した文字列を返します。
...自身を人間が読める形式に変換した文字列を返します。
//emlist[例][ruby]{
a = Thread.current
a.inspect # => "#<Thread:0x00007fdbaf07ddb0 run>"
b = Thread.new{}
b.inspect # => "#<Thread:0x00007fdbaf8f7d10@(irb):3 dead>"
//}... -
Thread
:: Mutex # sleep(timeout = nil) -> Integer (8007.0) -
与えられた秒数の間ロックを解除してスリープして、実行後にまたロックします。
...グナルを受信した場合などに実行が再
開(spurious wakeup)される場合がある点に注意してください。
//emlist[例][ruby]{
m = Mutex.new
th = Thread.new do
m.lock
m.sleep(2)
end
th.status # => "run"
sleep 1
th.status # => "sleep"
sleep 1
th.status # => false
//}... -
ThreadGroup
# list -> [Thread] (8007.0) -
self に属するスレッドの配列を返します。 version 1.8 では、aborting 状態であるスレッド も要素に含まれます。つまり「生きている」スレッドの配列を返します。
...するスレッドの配列を返します。
version 1.8 では、aborting 状態であるスレッド
も要素に含まれます。つまり「生きている」スレッドの配列を返します。
//emlist[例][ruby]{
ThreadGroup::Default.list # => [#<Thread:0x00007f8f13867078 run>]
//}...