lib/quack_concurrency/mutex.rb
def temporarily_release(&block)
      raise ArgumentError, 'no block given' unless block_given?
      unlock
      begin
        return_value = yield
        lock
      rescue Exception
        lock_immediately
        raise
      end
      return_value
    end
def temporarily_release(&block)
      raise ArgumentError, 'no block given' unless block_given?
      unlock
      begin
        return_value = yield
        lock
      rescue Exception
        lock_immediately
        raise
      end
      return_value
    end
def temporarily_release ( & block ) raise ArgumentError , 'no block given' unless block_given? unlock begin return_value = yield lock rescue Exception lock_immediately raise end return_value end
Temporarily unlocks it while a block is run.
 If an error is raised in the block the it will try to be immediately relocked
   before passing the error up. If unsuccessful, a +ThreadError+ will be raised to
   imitate the core's behavior.
 @api private
 @raise [ThreadError] if relock unsuccessful after an error
 @raise [ArgumentError] if no block given
 @return [void]
Temporarily unlocks it while a block is run . If an error is raised in the block the it will try to be immediately relocked before passing the error up . If unsuccessful a + ThreadError + will be raised to imitate the core s behavior .