WaitForMultipleObjects使用详解

类别:VC语言 点击:0 评论:0 推荐:
WaitForMultipleObjects

The WaitForMultipleObjects function returns when one of the following occurs: Either any one or all of the specified objects are in the signaled state. The time-out interval elapses.

To enter an alertable wait state, use the WaitForMultipleObjectsEx function.

DWORD WaitForMultipleObjects( DWORD nCount, // number of handles in array CONST HANDLE *lpHandles, // object-handle array BOOL bWaitAll, // wait option DWORD dwMilliseconds // time-out interval ); Parameters nCount [in] Specifies the number of object handles in the array pointed to by lpHandles. The maximum number of object handles is MAXIMUM_WAIT_OBJECTS. lpHandles [in] Pointer to an array of object handles. For a list of the object types whose handles can be specified, see the following Remarks section. The array can contain handles to objects of different types. It may not contain the multiple copies of the same handle.

If one of these handles is closed while the wait is still pending, the function's behavior is undefined.

Windows NT/2000/XP: The handles must have SYNCHRONIZE access. For more information, see

本文地址:http://com.8s8s.com/it/it362.htm