Method: Cond::ThreadLocal#initialize

Defined in:
lib/cond/thread_local.rb

#initialize(&default) ⇒ ThreadLocal

If value is called before value= then the result of &default is used.

&default normally creates a new object, otherwise the returned object will be shared across threads.



16
17
18
19
20
# File 'lib/cond/thread_local.rb', line 16

def initialize(&default)
  @name = gensym
  @accessed = gensym
  @default = default
end