64,282
社区成员
发帖
与我相关
我的任务
分享
//句柄丢进容器
hthreads.push_back(CreateThread(NULL,0,ModuThread,NULL,0,&t_id));
//等待结束
std::vector<HANDLE>::iterator it_hthr = hthreads.begin();
while (it_hthr != hthreads.end())
{
if (WaitForSingleObject((*it_hthr),INFINITE)!=WAIT_OBJECT_0)
{
std::cout<<"线程未正确结束"<<std::endl;
_ptracelog->error("线程未正确结束");
}
CloseHandle((*it_hthr));
it_hthr++;
}