48件ヒット
[1-48件を表示]
(0.290秒)
種類
- インスタンスメソッド (36)
- 文書 (12)
ライブラリ
- ビルトイン (36)
クラス
- Thread (36)
キーワード
-
NEWS for Ruby 2
. 0 . 0 (12) -
thread
_ variable? (12) -
thread
_ variable _ get (12)
検索結果
先頭4件
-
Thread
# thread _ variable _ set(key , value) (18230.0) -
引数 key で指定した名前のスレッドローカル変数に引数 value をセットしま す。
...引数 key で指定した名前のスレッドローカル変数に引数 value をセットしま
す。
[注意]: Thread#[] でセットしたローカル変数(Fiber ローカル変数)と
異なり、セットした変数は Fiber を切り替えても共通で使える事に注意してく......ださい。
//emlist[例][ruby]{
thr = Thread.new do
Thread.current.thread_variable_set(:cat, 'meow')
Thread.current.thread_variable_set("dog", 'woof')
end
thr.join # => #<Thread:0x401b3f10 dead>
thr.thread_variables # => [:dog, :cat]
//}
@see Thread#thread_variable_get, Threa... -
Thread
# thread _ variable?(key) -> bool (129.0) -
引数 key で指定した名前のスレッドローカル変数が存在する場合に true、そ うでない場合に false を返します。
...引数 key で指定した名前のスレッドローカル変数が存在する場合に true、そ
うでない場合に false を返します。
@param key 変数名を String か Symbol で指定します。
me = Thread.current
me.thread_variable_set(:oliver, "a")
me.thread_variable?... -
Thread
# thread _ variable _ get(key) -> object | nil (129.0) -
引数 key で指定した名前のスレッドローカル変数を返します。
...引数 key で指定した名前のスレッドローカル変数を返します。
[注意]: Thread#[] でセットしたローカル変数(Fiber ローカル変数)と
異なり、Fiber を切り替えても同じ変数を返す事に注意してください。
例:
Thread.new {
Thread.......current.thread_variable_set("foo", "bar") # スレッドローカル
Thread.current["foo"] = "bar" # Fiber ローカル
Fiber.new {
Fiber.yield [
Thread.current.thread_variable_get("foo"), # スレッドローカル
Thread.current["foo"],......}.resume
}.join.value # => ['bar', nil]
この例の "bar" は Thread#thread_variable_get により得られ
た値で、nil はThread#[] により得られた値です。
@see Thread#thread_variable_set, Thread#[]
@see https://magazine.rubyist.net/articles/0041/0041-200Special-note.html... -
NEWS for Ruby 2
. 0 . 0 (12.0) -
NEWS for Ruby 2.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...ariable_get スレッドローカルな変数を取得します
(these are different than Fiber local variables).
* 追加: Thread#thread_variable_set スレッドローカルな変数をセットします
* 追加: Thread#thread_variables スレッドローカルな変数の名前の......ur characters was possible, but accessing the
file afterwards failed. OpenSSL::PKey::RSA, OpenSSL::PKey::DSA and
OpenSSL::PKey::EC therefore now enforce the same check when exporting a
private key to PEM with a password - it has to be at least four characters
long.
* SSL/...