lib/garcon/task/count_down_latch.rb
# Block on the latch until the counter reaches zero or until `timeout` is
# reached.
#
# @param [Fixnum] timeout
#   The number of seconds to wait for the counter or `nil` to block
#   indefinitely.
# @return [Boolean]
#   True if the count reaches zero else false on timeout.
#
Block on the latch until the counter reaches zero or until `timeout` is
reached.
Block on the latch until the counter reaches zero or until ` timeout ` is reached .
def wait(timeout = nil)
      @mutex.synchronize do
        remaining    = Condition::Result.new(timeout)
        while @count > 0 && remaining.can_wait?
          remaining  = @condition.wait(@mutex, remaining.remaining_time)
        end
        @count == 0
      end
    end
def wait ( timeout = nil ) @mutex . synchronize do remaining = Condition :: Result . new ( timeout ) while @count > 0 && remaining . can_wait? remaining = @condition . wait ( @mutex , remaining . remaining_time ) end @count == 0 end end
Block on the latch until the counter reaches zero or until `timeout` is
reached.
Block on the latch until the counter reaches zero or until ` timeout ` is reached .
True if the count reaches zero else false on timeout.
True if the count reaches zero else false on timeout .
Boolean
timeout
<not_specific>
<not_specific>
timeout The number of seconds to wait for the counter or `nil` to block indefinitely.
timeout The number of seconds to wait for the counter or ` nil ` to block indefinitely .