你的运气不错(不好?),应该是.NET的一个全新臭虫。:)
本来应该Suspend -> Abort -> Resume,然后线程结束的,但是由于CLR的程序里面少掉了一个::ResumeThread,实际上造成了某种死锁,Suspend -> Abort之后线程就失去响应了,再也没有办法激活或者结束了。我会把这个Report到MS,如果有确认我会贴在这里。至于解决方法,没有好办法,绕过去吧。
比如先Resume然后再紧接着Abort,或者用更复杂的控制逻辑。

解决方案 »

  1.   

    >The problem is after this exception, that thread is hang. It won't 
    response to 
    >any function call include Resume, Suspend, Abort etc. And this hanging 
    thread 
    >prevents the whole application from terminating normally.Thanks for bringing this to our attention.  I did find this as an existing 
    bug in the bug database.  A couple of questions:What is the scenario in which this particular sequence (suspending, then 
    aborting, then resuming) would be useful? Also, do you have specific scenarios where suspending and resuming a thread 
    is useful (as opposed to using other inter-thread synchronization methods)? 
     The CLR team is interested in learning how people use this functionality 
    to better understand how to support it.
    >Here is my fixes for Rotor:
    >       // ****** code from Rotor, threads.cpp line 4084 with fixes*********
    >       if (m_State & TS_SyncSuspended) {
    >            // ThreadStore::TrapReturningThreads(FALSE);     //mchen: 
    comment this line out
    >           ::ResumeThread(hThread);                         //mchen: 
    Resume the physical threadAdding the ResumeThread is necessary but apparently just commenting out the 
    TrapReturningThreads call isn't sufficient to cover all the error cases.  I 
    don't have more data on this currently.JohnThis posting is provided "AS IS" with no warranties, and confers no rights.
      

  2.   

    上面的贴子是在msnewsgroup里面我得到的John Norwood [MS]的回复。
    是个bug没错的了。不过我还真的提不出 specific scenarios where suspending and resuming a thread is useful :)。
    不知道在你的程序当中是怎样的情形?