且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

C#如何杀死一个被阻塞的线程?

更新时间:2022-06-10 21:56:21

您可以致电 Thread.Abort的来血腥谋杀的主题。

You can call Thread.Abort to bloodily murder the thread.

线程将不会能清理后本身(除了最后块);这取决于到底是什么当时在做什么,它可能会严重打乱你的计划。

The thread will not be able to clean up after itself (except for finally blocks); depending on exactly what it was doing at the time, it could seriously mess up your program.