lib/quack_concurrency/mutex.rb
def sleep(timeout = nil)
      validate_timeout(timeout)
      unlock do
        if timeout == nil || timeout == Float::INFINITY
          elapsed_time = (timer { Thread.stop }).round
        else
          elapsed_time = Kernel.sleep(timeout)
        end
      end
    end
def sleep(timeout = nil)
      validate_timeout(timeout)
      unlock do
        if timeout == nil || timeout == Float::INFINITY
          elapsed_time = (timer { Thread.stop }).round
        else
          elapsed_time = Kernel.sleep(timeout)
        end
      end
    end
def sleep ( timeout = nil ) validate_timeout ( timeout ) unlock do if timeout == nil || timeout == Float :: INFINITY elapsed_time = ( timer { Thread . stop } ) . round else elapsed_time = Kernel . sleep ( timeout ) end end end
Releases the lock and puts this thread to sleep.
 @param timeout [nil, Numeric] time to sleep in seconds or +nil+ to sleep forever
 @raise [TypeError] if +timeout+ is not +nil+ or +Numeric+
 @raise [ArgumentError] if +timeout+ is not positive
 @return [Integer] elapsed time sleeping
Releases the lock and puts this thread to sleep .