|
The following functions are available to create an event object and set its state.
A thread uses the RtCreateEvent function to create an event object. The creating thread specifies the initial state of the object and whether it is a manual-reset or auto-reset event object. The creating thread can also specify a name for the event object. Threads in other processes can open a handle of an existing event object by specifying its name in a call to RtOpenEvent. For additional information about names for objects, see Object Names.
A thread can use RtPulseEvent to set the state of an event object to signaled and then reset it to non-signaled after releasing the appropriate number of waiting threads. For a manual-reset event object, all waiting threads are released. For an auto-reset event object, the function releases only a single waiting thread, even if multiple threads are waiting. If no threads are waiting, RtPulseEvent simply sets the state of the event object to nonsignaled and returns.
You use RtWaitForSingleObject and RtWaitForMultipleObjects to wait for an interprocess communication object (IPC) to become available. IPC objects include semaphores, mutexes, and events.
RtWaitForSingleObject waits for one RTX IPC object at a time. A thread can wait for a specified amount of time, after which processing continues even if the object is not signaled, or an infinite amount of time (the thread waits indefinitely until the object is signaled).
RtWaitForMultipleObjects waits for up to 16 RTX IPC objects. The first object to become available causes the wait to be broken. The RtWaitForMultipleObjects function only supports WAIT FOR ANY object, making it possible for processing to start before all the objects the thread is waiting for are signaled.