Class: Thread

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

Constant Summary collapse

LOCK =
Mutex.new

Instance Method Summary collapse

Instance Method Details

#freezeObject



65
66
67
68
# File 'lib/active_support/core_ext/thread.rb', line 65

def freeze
  _locals.freeze
  super
end

#thread_variable?(key) ⇒ Boolean

Returns:

  • (Boolean)


61
62
63
# File '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 '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 '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 'lib/active_support/core_ext/thread.rb', line 47

def thread_variables
  _locals.keys
end