Live Chat Icon For mobile
Live Chat Icon

I call invoke Abort on my threads, but they still do not terminate.

Platform: WinForms| Category: Threading

There are several possible reasons for this.

Invoking Abort on a suspended thread will have no effect until the thread is resumed. Once it is resumed, then the Abort will be carried out.

Also, when closing your application, you can make sure that the secondary threads are terminated by calling Join (myWorkerThread.Join) immediately after invoking Abort on the thread. For instance, this would be necessary if the thread is in the middle of an intensive operation, or even if it is simply sleeping.

Share with

Share on twitter
Share on facebook
Share on linkedin

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.