lib/master_lock/registry.rb
def register(lock, extend_interval)
      registration = Registration.new
      registration.lock = lock
      registration.mutex = Mutex.new
      registration.thread = Thread.current
      registration.acquired_at = Time.now
      registration.extend_interval = extend_interval
      registration.released = false
      @locks_mutex.synchronize do
        locks << registration
      end
      registration
    end
# Register a lock to be renewed every extend_interval seconds.
#
# @param lock [#extend] a currently held lock that can be extended
# @param extend_interval [Fixnum] the interval in seconds after before the
#   lock is extended
# @return [Registration] the receipt of registration
Register a lock to be renewed every extend_interval seconds.
Register a lock to be renewed every extend_interval seconds .
def register(lock, extend_interval)
      registration = Registration.new
      registration.lock = lock
      registration.mutex = Mutex.new
      registration.thread = Thread.current
      registration.acquired_at = Time.now
      registration.extend_interval = extend_interval
      registration.released = false
      @locks_mutex.synchronize do
        locks << registration
      end
      registration
    end
def register ( lock , extend_interval ) registration = Registration . new registration . lock = lock registration . mutex = Mutex . new registration . thread = Thread . current registration . acquired_at = Time . now registration . extend_interval = extend_interval registration . released = false @locks_mutex . synchronize do locks << registration end registration end
Register a lock to be renewed every extend_interval seconds.
Register a lock to be renewed every extend_interval seconds .
the receipt of registration
the receipt of registration
Registration
lock
a currently held lock that can be extended
a currently held lock that can be extended
extend_interval
the interval in seconds after before the lock is extended
the interval in seconds after before the lock is extended