这是对的吗?我想创建执行startHelper函数的stageList.size()线程,但我不知道如何在窗口上创建Linux waitid()
。
HANDLE *threads = new HANDLE[stageList.size()];
DWORD *thId = new DWORD[stageList.size()];
for (int i = 0; i < stageList.size(); i++) {
threads[i]=CreateThread(NULL, 0, startHelper, (LPVOID) stageList.at(i),0,&thId[i]);
if ( threads[i]== NULL) {
printf("CreateThread failed: %d\n",GetLastError());
}
}
答案 0 :(得分:2)
试试这个
WaitForMultipleObjects(stageList.size(),threads,true,INFINITE);