Class: Thread

Inherits:
Object show all
Defined in:
activesupport/lib/active_support/core_ext/thread.rb

Constant Summary collapse

LOCK =
Mutex.new

Instance Method Summary collapse

Instance Method Details

#thread_variable?(key) ⇒ Boolean

Returns:

  • (Boolean)

61
62
63
# File 'activesupport/lib/active_support/core_ext/thread.rb', line 61

def thread_variable?(key)
  locals.has_key?(key.to_sym)
end

#thread_variable_get(key) ⇒ Object


25
26
27
# File 'activesupport/lib/active_support/core_ext/thread.rb', line 25

def thread_variable_get(key)
  locals[key.to_sym]
end

#thread_variable_set(key, value) ⇒ Object


32
33
34
# File 'activesupport/lib/active_support/core_ext/thread.rb', line 32

def thread_variable_set(key, value)
  locals[key.to_sym] = value
end

#thread_variablesObject


47
48
49
# File 'activesupport/lib/active_support/core_ext/thread.rb', line 47

def thread_variables
  locals.keys
end