lib/concurrent/atomic/event.rb
# Wait a given number of seconds for the `Event` to be set by another
# thread. Will wait forever when no `timeout` value is given. Returns
# immediately if the `Event` has already been set.
#
# @return [Boolean] true if the `Event` was set before timeout else false
Wait a given number of seconds for the `Event` to be set by another
thread. Will wait forever when no `timeout` value is given. Returns
immediately if the `Event` has already been set.
Wait a given number of seconds for the ` Event ` to be set by another thread . Will wait forever when no ` timeout ` value is given . Returns immediately if the ` Event ` has already been set .
def wait(timeout = nil)
      @mutex.lock
      unless @set
        remaining = Condition::Result.new(timeout)
        while !@set && remaining.can_wait?
          remaining = @condition.wait(@mutex, remaining.remaining_time)
        end
      end
      @set
    ensure
      @mutex.unlock
    end
def wait ( timeout = nil ) @mutex . lock unless @set remaining = Condition :: Result . new ( timeout ) while ! @set && remaining . can_wait? remaining = @condition . wait ( @mutex , remaining . remaining_time ) end end @set ensure @mutex . unlock end
Wait a given number of seconds for the `Event` to be set by another
thread.
Wait a given number of seconds for the ` Event ` to be set by another thread .
true if the `Event` was set before timeout else false
true if the ` Event ` was set before timeout else false
Boolean
timeout
<not_specific>