你的运气不错(不好?),应该是.NET的一个全新臭虫。:)
本来应该Suspend -> Abort -> Resume,然后线程结束的,但是由于CLR的程序里面少掉了一个::ResumeThread,实际上造成了某种死锁,Suspend -> Abort之后线程就失去响应了,再也没有办法激活或者结束了。我会把这个Report到MS,如果有确认我会贴在这里。至于解决方法,没有好办法,绕过去吧。
比如先Resume然后再紧接着Abort,或者用更复杂的控制逻辑。
本来应该Suspend -> Abort -> Resume,然后线程结束的,但是由于CLR的程序里面少掉了一个::ResumeThread,实际上造成了某种死锁,Suspend -> Abort之后线程就失去响应了,再也没有办法激活或者结束了。我会把这个Report到MS,如果有确认我会贴在这里。至于解决方法,没有好办法,绕过去吧。
比如先Resume然后再紧接着Abort,或者用更复杂的控制逻辑。
解决方案 »
- 请各位高人大虾帮小弟指点 ,我这个方法这么写的话,是在做一个什么操作 ,请帮我分析一下。谢谢
- div联动怎么写?默认是第一个div,当鼠标移动到第一个按钮显示第二个div,其他的div隐藏
- 一个类似于火车站城市检索的问题
- 如何隐藏一个进程
- ORA-12154: TNS: 无法解析指定的连接?寻求解决方法
- InvalidCastException
- 如何获得当前显示器的状态
- 请教C#高手
- c# 写的 WINCE 程序,如何做到反编译
- [请问,关于Session]在我的机器里Session使用正常,而别人访问我的时候Session就失效
- 如何在一个类中调用另一个类的变量
- 请问C#中怎么拷贝一个文件夹包括子目录?
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.
是个bug没错的了。不过我还真的提不出 specific scenarios where suspending and resuming a thread is useful :)。
不知道在你的程序当中是怎样的情形?