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) ⇒ generic<T>
@sg-ignore
14 15 16 17 18 19 20 |
# File 'lib/checkoff/internal/thread_local.rb', line 14 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 |