Module: ProcessShared::SynchronizableSemaphore
- Included in:
- Mach::Semaphore, Posix::Semaphore
- Defined in:
- lib/process_shared/synchronizable_semaphore.rb
Defined Under Namespace
Classes: FasterUncheckedMutex
Instance Method Summary collapse
-
#synchronize ⇒ Object
Yield the block after decrementing the semaphore, ensuring that the semaphore is incremented.
-
#to_mtx ⇒ FasterUncheckedMutex
Expose an unchecked mutex-like interface using only this semaphore.
Instance Method Details
#synchronize ⇒ Object
Yield the block after decrementing the semaphore, ensuring that the semaphore is incremented.
9 10 11 12 13 14 15 16 |
# File 'lib/process_shared/synchronizable_semaphore.rb', line 9 def synchronize wait begin yield ensure post end end |
#to_mtx ⇒ FasterUncheckedMutex
Expose an unchecked mutex-like interface using only this semaphore.
21 22 23 |
# File 'lib/process_shared/synchronizable_semaphore.rb', line 21 def to_mtx FasterUncheckedMutex.new(self) end |