module FiniteMachine::Threadable::InstanceMethods

Public Instance Methods

sync_exclusive(&block) click to toggle source

Exclusive lock

@return [nil]

@api public

# File lib/finite_machine/threadable.rb, line 14
def sync_exclusive(&block)
  TwoPhaseLock.synchronize(:EX, &block)
end
sync_shared(&block) click to toggle source

Shared lock

@return [nil]

@api public

# File lib/finite_machine/threadable.rb, line 23
def sync_shared(&block)
  TwoPhaseLock.synchronize(:SH, &block)
end