class MonitorMixin::ConditionVariable

Public Instance Methods

broadcast() click to toggle source
# File lib/rbot/compat19.rb, line 58
def broadcast
  @monitor.__send__(:mon_check_owner)
  @cond.broadcast
end
signal() click to toggle source
# File lib/rbot/compat19.rb, line 53
def signal
  @monitor.__send__(:mon_check_owner)
  @cond.signal
end
wait(timeout = nil) click to toggle source
# File lib/rbot/compat19.rb, line 39
def wait(timeout = nil)
  #if timeout
  #  raise NotImplementedError, "timeout is not implemented yet"
  #end
  @monitor.__send__(:mon_check_owner)
  count = @monitor.__send__(:mon_exit_for_cond)
  begin
    @cond.wait(@monitor.instance_variable_get("@mon_mutex"), timeout)
    return true
  ensure
    @monitor.__send__(:mon_enter_for_cond, count)
  end
end