Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
Previous Versions
.NET Framework 2.0
System.Threading
Thread Class
Thread Methods
Abort Method

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2005/.NET Framework 2.0

Other versions are also available for the following:
.NET Framework Class Library
Thread.Abort Method

Raises a ThreadAbortException in the thread on which it is invoked, to begin the process of terminating the thread. Calling this method usually terminates the thread.

Name Description
Thread.Abort () Raises a ThreadAbortException in the thread on which it is invoked, to begin the process of terminating the thread. Calling this method usually terminates the thread.

Supported by the .NET Compact Framework.

Thread.Abort (Object) Raises a ThreadAbortException in the thread on which it is invoked, to begin the process of terminating the thread while also providing exception information about the thread termination. Calling this method usually terminates the thread.

Supported by the .NET Compact Framework.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Thead.Abort should be avoided.      Peter Ritchie   |   Edit   |   Show History
There's many reasons not to use Thread.Abort and ThreadAbortException
  • On certain platforms (like x64 and IA64) the abort can occur before Monitor.Enter and a try block (even with lock/SyncLock), leaving the monitor orphaned.
  • The ThreadAbortException can occur in 3rd party code not written to handle thread abort.
  • The thread can be aborted while processing a finally block in .NET 1.x
  • Uses exceptions for normal control flow logic.
  • Asynchronous exception can interrupt modification of shard state or resources, leaving them corrupted.

For more detail see:

Alternative programming to using Thread.Abort      jZe   |   Edit   |   Show History
See
"Overview of Synchronization Primitives"
http://msdn.microsoft.com/en-us/library/ms228964.aspx

and
"Managed Threading Best Practices" for more information on how to avoid using Abort
http://msdn.microsoft.com/en-us/library/1c9txz50.aspx?wt.slv=ColumnA
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker