INtime SDK Help
WaitForMultipleObjects, RtWaitForMultipleObjects (iwin32)
INtime SDK v7.1 > About INtime > Alternate APIs > iwin32 API > iwin32 API > WaitForMultipleObjects, RtWaitForMultipleObjects (iwin32)

Waits until either specified object is in the signaled state, or until the time-out interval elapses.

DWORD WaitForMultipleObjects(
    DWORD nCount,
    CONST HANDLE * lpHandles,
    BOOLEAN bWaitAll,
    DWORD dwMilliseconds

DWORD RtWaitForMultipleObjects(
    DWORD nCount,
    CONST HANDLE * lpHandles,
    BOOLEAN bWaitAll,
    DWORD dwMilliseconds


Specifies the number of object handles in the array pointed to by lpHandles. The maximum number of object handles is MAXIMUM_WAIT_OBJECTS which, in INtime, is 16.
Pointer to an array of object handles. For a list of object types whose handles can be specified, see the Remarks section. The array can contain handles of objects of different types.
Specifies the wait type. This parameter must be set to FALSE. This causes the function to return when the state of any of the objects set to is signaled. The return value indicates the object whose state caused the function to return.
Specifies the time-out interval in milliseconds. If the interval elapses, the function returns, even if the conditions specified by the bWaitAll parameter are not met. If dwMilliseconds is zero, the function tests the states of specified objects and returns immediately. If dwMilliseconds is INFINITE, the function's time-out interval never elapses.


When one object is deleted while the thread waits, the thread wakes and ERROR_INVALID_HANDLE is set.

These functions cannot be called from a pure INtime thread.

WaitForMultipleObjects can specify handles of any of the following object types in the lpHandles array:

Return Values

WAIT_OBJECT_0 to (WAIT_OBJECT_0 + nCount - 1) Success. The return value minus WAIT_OBJECT_0 indicates the lpHandles array index of the object that satisfied the wait. If more than one object became signaled during the call, this is the array index of the first signaled object.
WAIT_ABANDONED_0 to (WAIT_ABANDONED_0 + nCount - 1) Success. The return value minus WAIT_ABANDONED_0 indicates the lpHandles array index of the object that was deleted while waiting.
WAIT_TIMEOUT Success. The time-out interval elapsed and the condition specified by the fWaitAll parameter is not satisfied.
WAIT_FAILED Failure. For extended error information, see GetLastError.


Versions Defined in Include Link to
INtime 3.0 intime/rt/include/iwin32.h


See Also