Class: Thread
- Inherits:
-
Object
- Object
- Thread
- Defined in:
- lib/rubysl/thread/thread.rb
Class Method Summary collapse
-
.exclusive ⇒ Object
Wraps a block in Thread.critical, restoring the original value upon exit from the critical section.
Class Method Details
.exclusive ⇒ Object
Wraps a block in Thread.critical, restoring the original value upon exit from the critical section.
29 30 31 32 33 34 35 36 37 |
# File 'lib/rubysl/thread/thread.rb', line 29 def Thread.exclusive _old = Thread.critical begin Thread.critical = true return yield ensure Thread.critical = _old end end |