441件ヒット
[401-441件を表示]
(0.072秒)
ライブラリ
- ビルトイン (441)
キーワード
- [] (12)
- []= (12)
-
abort
_ on _ exception (12) -
abort
_ on _ exception= (12) -
add
_ trace _ func (12) - alive? (12)
- backtrace (12)
-
backtrace
_ locations (24) - exit (12)
- fetch (8)
- group (12)
-
ignore
_ deadlock (4) -
ignore
_ deadlock= (4) - inspect (12)
- join (24)
- key? (12)
- keys (12)
- kill (12)
- name (10)
- name= (10)
-
pending
_ interrupt? (12) - priority (12)
- priority= (12)
- raise (12)
-
report
_ on _ exception (9) -
report
_ on _ exception= (9) - run (12)
-
safe
_ level (7) -
set
_ trace _ func (12) - status (12)
- stop? (12)
- terminate (12)
-
thread
_ variable? (12) -
thread
_ variable _ get (12) -
thread
_ variable _ set (12) -
to
_ s (8) - value (12)
- wakeup (12)
検索結果
先頭4件
-
Thread
# thread _ variable _ set(key , value) (2.0) -
引数 key で指定した名前のスレッドローカル変数に引数 value をセットしま す。
...]: Thread#[] でセットしたローカル変数(Fiber ローカル変数)と
異なり、セットした変数は Fiber を切り替えても共通で使える事に注意してく
ださい。
//emlist[例][ruby]{
thr = Thread.new do
Thread.current.thread_variable_set(:cat, 'meow')
Thread.c......urrent.thread_variable_set("dog", 'woof')
end
thr.join # => #<Thread:0x401b3f10 dead>
thr.thread_variables # => [:dog, :cat]
//}
@see Thread#thread_variable_get, Thread#[]... -
Thread
# to _ s -> String (2.0) -
自身を人間が読める形式に変換した文字列を返します。
...自身を人間が読める形式に変換した文字列を返します。
//emlist[例][ruby]{
a = Thread.current
a.inspect # => "#<Thread:0x00007fdbaf07ddb0 run>"
b = Thread.new{}
b.inspect # => "#<Thread:0x00007fdbaf8f7d10@(irb):3 dead>"
//}... -
Thread
# value -> object (2.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}... -
Thread
# wakeup -> self (2.0) -
停止状態(stop)のスレッドを実行可能状態(run)にします。
...を実行可能状態(run)にします。
@raise ThreadError 死んでいるスレッドに対して実行すると発生します。
//emlist[例][ruby]{
c = Thread.new { Thread.stop; puts "hey!" }
sleep 0.1 while c.status!='sleep'
c.wakeup
c.join
# => "hey!"
//}
@see Thread#run, Thread.stop...