Module: FiniteMachine::Threadable::InstanceMethods

Included in:
ClassMethods
Defined in:
lib/finite_machine/threadable.rb

Instance Method Summary collapse

Instance Method Details

#sync_exclusive(&block) ⇒ nil

Exclusive lock

Returns:

  • (nil)


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

Returns:

  • (nil)


23
24
25
# File 'lib/finite_machine/threadable.rb', line 23

def sync_shared(&block)
  TwoPhaseLock.synchronize(:SH, &block)
end