Class: Checkoff::Internal::ThreadLocal
- Inherits:
-
Object
- Object
- Checkoff::Internal::ThreadLocal
- Defined in:
- lib/checkoff/internal/thread_local.rb
Overview
Manage thread lock variables in a block
Instance Method Summary collapse
Instance Method Details
#with_thread_local_variable(name, value, &block) ⇒ Object, Boolean
@sg-ignore
13 14 15 16 17 18 19 |
# File 'lib/checkoff/internal/thread_local.rb', line 13 def with_thread_local_variable(name, value, &block) old_value = Thread.current[name] Thread.current[name] = value block.yield ensure Thread.current[name] = old_value end |