[Overview][Constants][Types][Classes][Index] Reference for unit 'syncobjs' (#fcl)


Wait for the event to be set.


Source position: syncobjs.pp line 74

public function TEventObject.WaitFor(

  Timeout: Cardinal





Maximum time to wait for the event to be set

Function result

Reason for returning


WaitFor should be used in threads that should be notified when the event is set. When WaitFor is called, and the event is not set, the thread will be suspended. As soon as the event is set by some other thread (using SetEvent) or the timeout period (TimeOut) has expired, the WaitFor function returns. The return value depends on the condition that caused the WaitFor function to return.

The calling thread will wait indefinitely when the constant INFINITE is specified for the TimeOut parameter.

See also



Set the event

Documentation generated on: May 14 2021