問題描述
我不確定為什么會發生這種情況,而且我從未明確中止線程,所以這有點令人驚訝.但是我記錄了異常并且我看到了:
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.ThreadAbortException - Thread was being aborted.
這似乎發生在對 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 中?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!