Module: FiniteMachine::Threadable::InstanceMethods
- Included in:
- ClassMethods
- Defined in:
- lib/finite_machine/threadable.rb
Instance Method Summary collapse
-
#sync_exclusive(&block) ⇒ nil
Exclusive lock.
-
#sync_shared(&block) ⇒ nil
Shared lock.
Instance Method Details
#sync_exclusive(&block) ⇒ nil
Exclusive lock
14 15 16 |
# File 'lib/finite_machine/threadable.rb', line 14 def sync_exclusive(&block) TwoPhaseLock.synchronize(:EX, &block) end |
#sync_shared(&block) ⇒ nil
Shared lock
23 24 25 |
# File 'lib/finite_machine/threadable.rb', line 23 def sync_shared(&block) TwoPhaseLock.synchronize(:SH, &block) end |