问题描述
我不确定为什么会发生这种情况,而且我从来没有明确地中止线程,所以这有点令人惊讶.但我记录了异常,我看到:
I am not sure why this happens and I never explicitly abort threads, so it's a bit of a surprise. But I log Exceptions and I am seeing:
System.Threading.ThreadAbortException - 线程被中止.
它似乎发生在对 System.Threading.WaitHandle.WaitOne
的调用中.我不确定这个异常有多远.我认为我的线程永远不会终止,因为我捕获日志并吞下错误.
It appears to happen in a call to System.Threading.WaitHandle.WaitOne
. I am not sure how far this Exception goes. I don't think my threads ever terminate, because I catch log and swallow the error.
为什么我会收到这些错误?也许是在我强行终止服务器或要求它重新启动时?如果不是,那么可能是什么导致了它们?
Why am I getting these errors? Perhaps it's when I am forcefully terminating my server or asking it to reboot? If it isn't then what might be causing them?
推荐答案
不,ThreadAbortException
是由一个简单的 Response.Redirect
Nope, ThreadAbortException
is thrown by a simple Response.Redirect
这篇关于为什么我收到“线程被中止"的消息?在 ASP.NET 中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!