Module: FiniteMachine::TwoPhaseLock Private
- Defined in:
- lib/finite_machine/two_phase_lock.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Mixin to provide lock to a Threadable
Class Method Summary collapse
-
.lock ⇒ Sync
private
Create synchronization lock.
-
.synchronize(mode, &block) ⇒ nil
private
Synchronize given block of code.
Class Method Details
.lock ⇒ Sync
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Create synchronization lock
15 16 17 |
# File 'lib/finite_machine/two_phase_lock.rb', line 15 def lock @lock = Sync.new end |
.synchronize(mode, &block) ⇒ nil
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Synchronize given block of code
28 29 30 |
# File 'lib/finite_machine/two_phase_lock.rb', line 28 def synchronize(mode, &block) lock.synchronize(mode, &block) end |