线程已经return 0了,但GetExitCodeThread的ExitCode一直是STILL_ACTIVE,检测代码如下:
for(int i = 0; i < m_nThreads; i++)
{
while(true)
{
DWORD dwExitcode = 0;
GetExitCodeThread(m_phWorkerThreads[i], &dwExitcode);
if(dwExitcode != STILL_ACTIVE)
break;
Sleep(1);
}
}
其中m_nThreads的数量是2;
m_phWorkerThreads是HANDLE数组,保存CreateThread时的HANDLE值。
搞不懂为什么线程已经return 0了,但GetExitCodeThread的ExitCode一直是STILL_ACTIVE。