How does Thread.Abort() work?

前端 未结 5 653
鱼传尺愫
鱼传尺愫 2020-12-08 16:41

We usually throw exception when invalid input is passed to a method or when a object is about to enter invalid state. Let\'s consider the following example

         


        
5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-08 16:44

    Are you sure you read the page you were pointing to? In the end it boils down to:

    The call to Thread.Abort boils down to .NET setting a flag on a thread to be aborted and then checking that flag during certain points in the thread’s lifetime, throwing the exception if the flag is set.

提交回复
热议问题