如何得到通知,一个线程是正在运行还是被SuspendThread函数暂停还有,在线程内调用NEW操作符,所得到的内存是创建在堆上还是在栈上

解决方案 »

  1.   

    在线程内调用NEW操作符,所得到的内存是创建在堆上还是在栈上
    =========
    当然是堆上
      

  2.   

    WaitForMultipleObjects()Return Code Description 
    WAIT_OBJECT_0 to (WAIT_OBJECT_0 + nCount – 1) If bWaitAll is TRUE, the return value indicates that the state of all specified objects is signaled. 
    If bWaitAll is FALSE, the return value minus WAIT_OBJECT_0 indicates the lpHandles array index of the object that satisfied the wait. If more than one object became signalled during the call, this is the array index of the signalled object with the smallest index value of all the signalled objects.
     
    WAIT_ABANDONED_0 to (WAIT_ABANDONED_0 + nCount – 1) If bWaitAll is TRUE, the return value indicates that the state of all specified objects is signaled and at least one of the objects is an abandoned mutex object. 
    If bWaitAll is FALSE, the return value minus WAIT_ABANDONED_0 indicates the lpHandles array index of an abandoned mutex object that satisfied the wait.
     
    WAIT_TIMEOUT The time-out interval elapsed and the conditions specified by the bWaitAll parameter are not satisfied. 
      

  3.   

    可能WaitForMultipleObjects还是不行,你可以用事件量Event或信号量进行通知。
      

  4.   

    我用一个BOOL值标识,增加了复杂性。但是可以实现。事件量应该可以。谢谢大家的热心帮助