Thread..::.Abort Method
This page is specific to:.NET Framework Version:1.12.03.03.54.0
.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.

Overload List

  NameDescription
Public methodSupported by the .NET Compact FrameworkSupported by the XNA FrameworkAbort()()()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.
Public methodSupported by the .NET Compact FrameworkSupported by the XNA FrameworkAbort(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.
Top
See Also

Reference

Community Content

Thead.Abort should be avoided.
Added by:Peter Ritchie
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:

  • http://msmvps.com/blogs/peterritchie/archive/2007/08/22/thead-abort-is-a-sign-of-a-poorly-designed-program.aspx
  • http://www.bluebytesoftware.com/blog/2007/01/30/MonitorEnterThreadAbortsAndOrphanedLocks.aspx
  • http://blogs.msdn.com/ericlippert/archive/2007/08/17/subtleties-of-c-il-codegen.aspx
© 2009 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View