Welcome to MSDN Blogs Sign in | Join | Help
ThreadAbortException and Unmanaged Code

As you are probably aware Thread.Abort() raises a ThreadAbortException in the thread on which it is invoked, to begin the process of terminating the thread.

Please note that if Abort is called on a managed thread while it is executing unmanaged code, a ThreadAbortException is not thrown until the thread returns to managed code. That is also true when performing a COM Interop or P-Invoke. However if you have a ServicedComponent, the exception is received by the thread inside the component as expected. For instance if you are in an ASP.NET application and a timeout is occurred (timeout is communicated in terms of a ThreadAbortException) the exception is raised inside the component.

Posted: Tuesday, October 02, 2007 1:04 PM by pedramr
Filed under: , , ,
Leave a Comment

(required) 

(required) 

(optional)

(required) 

  
Enter Code Here: Required

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Page view tracker