如题

解决方案 »

  1.   

    waiteforobject()    是不是这个?不太清楚
      

  2.   

    你要的是GetExitCodeThread吗?
      

  3.   

    pthread里有joinable模式可以看看
      

  4.   

    GetExitCodeThread,判断返回值是常用办法
      

  5.   

    判断是否还在啊,对句柄使用一下if就ok咯
      

  6.   

    你在线程自身退出的时候将句柄closehandle,然后置NULL,
    别的线程需要使用的地方使用
    if (hangle)
    或者
    waittingforsingleobject处理就可以了。
      

  7.   


    if (AfxIsMemoryBlock(m_thread, sizeof(CWinThread)))
    {
        if (WaitForSingleObject(m_thread->m_hThread, 200) != WAIT_OBJECT_0)
        {
    DWORD ExitCode;
    if (::GetExitCodeThread(m_thread->m_hThread, &ExitCode) && STILL_ACTIVE == ExitCode)
    {
        TerminateThread(m_thread->m_hThread, 0);
        m_thread = NULL;
    }
        }
    }
    m_thread = NULL;