제어 프로그램에서thread 동시 실행 수 시도 (二)

1109 단어 threadobjectfunction
static HANDLE m_ 선언SignalArray[MAX_THREADCOUNT];
스레드 함수에서 DWORD SignalHandle = WaitForMultiple Objects(MAX_THREADCOUNT, m_SignalArray, FALSE, 인피니트) 호출; ::ResetEvent(m_SignalArray[SignalHandle - WAIT_OBJECT_0]);//Do something here 
 ::SetEvent(m_SignalArray[SignalHandle - WAIT_OBJECT_0]);
 
DWORD WaitForMultipleObjects(
  DWORD nCount,
  const HANDLE* lpHandles,
  BOOL bWaitAll,
  DWORD dwMilliseconds
);

  
  
  
  
bWaitAll
[in] If this parameter is TRUE, the function returns when the state of all objects in the
lpHandles array is signaled. If FALSE, the function returns when the state of any one of the objects is set to signaled. In the latter case, the return value indicates the object whose state caused the function to return.

좋은 웹페이지 즐겨찾기