ICLRTask2::EndPreventAsyncAbort Method

Allows new or pending thread abort requests to result in thread aborts on the current thread.

HRESULT EndPreventAsyncAbort();

This method returns the following specific HRESULTs as well as HRESULT errors that indicate method failure.




The method completed successfully.


The method was called on a thread which is not the current thread.

Calling this method decrements the delay-thread-abort counter for the current thread by one.

Calls to ICLRTask2::BeginPreventAsyncAbort and EndPreventAsyncAbort can be nested. As long as the counter is greater than zero, thread aborts for the current thread are delayed.

The functionality that is exposed by this feature is used internally by the virtual machine (VM). Misuse of these methods may cause unspecified behavior in the VM. For example, calling EndPreventAsyncAbort without first calling BeginPreventAsyncAbort could set the counter to zero when the VM has previously incremented it. Similarly, the internal counter is not checked for overflow. If it exceeds its integral limit because it is incremented by both the host and the VM, the resulting behavior is unspecified.

Platforms: See .NET Framework System Requirements.

Header: MSCorEE.h

Library: Included as a resource in MSCorEE.dll

.NET Framework Versions: 4.5, 4

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft