Class: Thread
- Defined in:
- activesupport/lib/active_support/core_ext/thread.rb
Constant Summary collapse
- LOCK =
Mutex.new
Instance Method Summary collapse
- #thread_variable?(key) ⇒ Boolean
- #thread_variable_get(key) ⇒ Object
- #thread_variable_set(key, value) ⇒ Object
- #thread_variables ⇒ Object
Instance Method Details
#thread_variable?(key) ⇒ 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_variables ⇒ Object
47 48 49 |
# File 'activesupport/lib/active_support/core_ext/thread.rb', line 47 def thread_variables locals.keys end |