Programming Reference:OSEvent Class
The OSEvent class provides a wrapper for OS-dependent synchronization functionality. The underlying functionality corresponds to a manual-reset event in Windows; on Unix systems, equivalent behavior is achieved using a POSIX threads condition variable.
Events are created in non-signaled state.
Releases all resources allocated for the event object.
Sets the event to signaled state. When one or more threads are blocked waiting for the event, they are released in random order. As long as the event is in signaled state, threads calling its Wait() function will not be blocked. Returns true when successful, false otherwise.
Resets the event to non-signaled state. Call Reset() immediately after Wait() to emulate the behavior of a Windows auto-reset event. Returns true when successful, false otherwise.
bool Wait([number timeout])
Waits for the event to become signaled. Does nothing when the event is currently in signaled state. When a timeout is specified, waits for the specified number of milliseconds. Returns true when the event is signaled, and false otherwise (error or timeout occurred).