るりまサーチ (Ruby 3.3)

最速Rubyリファレンスマニュアル検索!
2件ヒット [1-2件を表示] (0.050秒)
トップページ > ライブラリ:ビルトイン[x] > クエリ:_builtin[x] > クエリ:default[x] > クエリ:Default[x] > バージョン:3.3[x] > クラス:Thread[x]

別のキーワード

  1. uri default_port
  2. _builtin default
  3. generic default_port
  4. socket ai_default
  5. socket ip_default_multicast_ttl

キーワード

検索結果

Thread#fetch(name, default = nil) {|name| ... } -> object (24784.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#[]...

Thread#group -> ThreadGroup (24046.0)

スレッドが属している ThreadGroup オブジェクトを返します。

...スレッドが属している ThreadGroup オブジェクトを返します。

p Thread.current.group == ThreadGroup::Default
# => true...