SunpendThread()函数中
MSDN的描述: 
If the suspend count is greater than zero, the thread is suspended; otherwise, the thread is not suspended and is eligible for execution. 但我在测试的时候:
        numSuspend = m_pThreadFun->SuspendThread();
TRACE(L"%d\n", numSuspend);
这里的numSunpend值为0.
也就是说首次执行些函数的时候,此值为0.
可否能够这样理解,当>=0的时候,线程就已经被挂起了。
能通过全局变量numSuspend来判断线程是否是挂起状态吗(如果>=0,就是被挂起)

解决方案 »

  1.   

    The ResumeThread function checks the suspend count of the subject thread. If the suspend count is zero, the thread is not currently suspended. Otherwise, the subject thread's suspend count is decremented. If the resulting value is zero, then the execution of the subject thread is resumed.
      

  2.   

    “ is greater than zero,”
    是 > 0 ,不是 >=0 
      

  3.   

    能通过全局变量numSuspend来判断线程是否是挂起状态吗(如果>=0,就是被挂起)全局变量numSuspend, 这个变量是你的, 比如有其他进程对你的线程进行操作, 你的变量就无法改变, 这时就没法根据这个判断