Method: Rex::Sync::Event#wait

Defined in:
lib/rex/sync/event.rb

#wait(t = Infinite) ⇒ Object

Waits for the event to become signaled. Timeout is measured in seconds. Raises TimeoutError if the condition does not become signaled.



64
65
66
67
68
69
70
71
72
73
74
# File 'lib/rex/sync/event.rb', line 64

def wait(t = Infinite)
  self.mutex.synchronize {
    break if (self.state == true)

    Timeout.timeout(t) {
      self.cond.wait(self.mutex)
    }
  }

  return self.param
end