When is Thread.Abort () not actually interrupted?

So, you read the title when Thread.Abort () is not actually interrupted? I heard that many people say that this is a dangerous team and that it will never be guaranteed, but I could never play it. It always worked for me.

Are there any specific situations that could cause Thread.Abort () to fail to execute sequentially ?

+5
source share
1 answer

Have you even read the documentation ?

A thread cannot be undone immediately or at all. This situation can occur if a thread performs an unlimited number of calculations in finally blocks, which are called part of the interrupt procedure, thereby delaying the interrupt indefinitely. To wait until the thread is interrupted, you can call the Join method on the thread after calling the Abort method, but there is no guarantee that the wait will end.

...

If Abort is called on a thread that has not been started, the thread is interrupted when Start is called. If Abort is called on a thread that is blocked or sleeping, the thread is interrupted and then interrupted.

Abort , , , Abort, ThreadStateException, AbortRequested ThreadState , . A ThreadAbortException , .

Abort , , ThreadAbortException , .

Abort , , - Abort. .

, Abort , AbortRequested. , Abort, Stopped. , Abort, , ResetAbort. , ResetAbort, . ThreadAbortException.

+9

All Articles