你的运气不错(不好?),应该是.NET的一个全新臭虫。:)
本来应该Suspend -> Abort -> Resume,然后线程结束的,但是由于CLR的程序里面少掉了一个::ResumeThread,实际上造成了某种死锁,Suspend -> Abort之后线程就失去响应了,再也没有办法激活或者结束了。我会把这个Report到MS,如果有确认我会贴在这里。至于解决方法,没有好办法,绕过去吧。
比如先Resume然后再紧接着Abort,或者用更复杂的控制逻辑。
本来应该Suspend -> Abort -> Resume,然后线程结束的,但是由于CLR的程序里面少掉了一个::ResumeThread,实际上造成了某种死锁,Suspend -> Abort之后线程就失去响应了,再也没有办法激活或者结束了。我会把这个Report到MS,如果有确认我会贴在这里。至于解决方法,没有好办法,绕过去吧。
比如先Resume然后再紧接着Abort,或者用更复杂的控制逻辑。
解决方案 »
- 【求帮助!!】用下列代码打印C#Winform界面,如何按照所选纸张大小,让内容能全部打印出来?因为全屏的话,默认的A4纸打不完整。要压缩吗?求高手指导!!
- 刚完成个C/S 项目,想作个压力测试,不知道怎么作?
- TCP/IP协议无消息边界问题。
- 如何在aspx中 把request.queryForm("参数")的参数显示在任意的位置?
- 这样的察询有问题吗?
- 关于反射的一些小问题,大家帮忙。。。谢谢。。。
- CalendarExtender控件格式設置
- IP地址如何加1?
- 在调代码的时候,自动窗体里发现有的变量颜色是"红"的,怎么回事?
- 怎样实现分形技术
- 如何在一个类中调用另一个类的变量
- 请问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 :)。
不知道在你的程序当中是怎样的情形?