msdn对SuspendThread 的说明:
This function is primarily designed for use by debuggers. It is not intended to be used for thread synchronization. Calling SuspendThread on a thread that owns a synchronization object, such as a mutex or critical section, can lead to a deadlock if the calling thread tries to obtain a synchronization object owned by a suspended thread. To avoid this situation, a thread within an application that is not a debugger should signal the other thread to suspend itself. The target thread must be designed to watch for this signal and respond appropriately.
虽然大家都知道尽量不要在外面调用 SuspendThread 暂停线程,不要用 TerminateThread 结束线程,但是都停留在感性认识阶段,这里给出了一段示例代码,看看 SuspendThread 造成死锁的情况。