EClrOperation Enumeration
Describes the set of operations for which a host can apply policy actions.
typedef enum {
OPR_ThreadAbort,
OPR_ThreadRudeAbortInNonCriticalRegion,
OPR_ThreadRudeAbortInCriticalRegion,
OPR_AppDomainUnload,
OPR_AppDomainRudeUnload,
OPR_ProcessExit,
OPR_FinalizerRun
} EClrOperation;
Member | Description |
---|---|
OPR_AppDomainRudeUnload |
The host can specify policy actions to be taken when an AppDomain is unloaded in a non-graceful (rude) manner. |
OPR_AppDomainUnload |
The host can specify policy actions to be taken when an AppDomain is unloaded. |
OPR_FinalizerRun |
The host can specify policy actions to be taken when finalizers run. |
OPR_ProcessExit |
The host can specify policy actions to be taken when the process exits. |
OPR_ThreadAbort |
The host can specify policy actions to be taken when a thread is aborted. |
OPR_ThreadRudeAbortInCriticalRegion |
The host can specify policy actions to be taken when a rude thread abort occurs in a critical region of code. |
OPR_ThreadRudeAbortInNonCriticalRegion |
The host can specify policy actions to be take when a rude thread abort occurs in a non-critical region of code. |
The common language runtime (CLR) reliability infrastructure distinguishes between aborts and resource allocation failures that occur in critical regions of code and those that occur in non-critical regions of code. This distinction is designed to allow hosts to set different policies depending on where a failure occurs in the code.
A critical region of code is any space where the CLR cannot guarantee that aborting a task or failing to complete a request for resources will affect only the current task. For example, if a task is holding a lock and receives an HRESULT that indicates failure upon making a memory allocation request, it is insufficient simply to abort that task to ensure the stability of the AppDomain, because the AppDomain might contain other tasks waiting for the same lock. To abandon the current task might cause those other tasks to stop responding. In such a case, the host needs the ability to unload the entire AppDomain rather than risk potential instability.
A non-critical region of code, on the other hand, is a region where the CLR can guarantee that an abort or a failure will affect only the task upon which the error occurs.
The CLR also distinguishes between graceful and non-graceful (rude) aborts. In general, a normal or graceful abort makes every effort to run exception-handling routines and finalizers before aborting a task, while a rude abort makes no such guarantees.
Platforms: See System Requirements.
Header: MSCorEE.h
Library: MSCorEE.dll
.NET Framework Versions: Available since 2.0
.NET feedback
.NET is an open source project. Select a link to provide feedback: