るりまサーチ

最速Rubyリファレンスマニュアル検索!
8件ヒット [1-8件を表示] (0.010秒)
トップページ > クエリ:etc[x] > クラス:Thread[x]

別のキーワード

  1. etc passwd
  2. etc group
  3. etc each
  4. etc gid
  5. etc gid=

ライブラリ

検索結果

Thread#fetch(name, default = nil) {|name| ... } -> object (6101.0)

name に関連づけられたスレッドに固有のデータを返します。 name に対応するスレッド固有データがない時には、引数 default が 与えられていればその値を、ブロックが与えられていれば そのブロックを評価した値を返します。

...と発生します。

//emlist[例][ruby]{
th = Thread.new { Thread.current[:name] = 'A' }
th.join
th.fetch(:name) # => "A"
th.fetch(:fetch, 'B') # => "B"
th.fetch('name') {|name| "Thread" + name} # => "A"
th.fetch('fetch') {|name| "Thread" + name} # => "Threadfetch"
//}

@see Thread#[]...