int n;
for (n = 0; n < MaxClrOperation; n++) {
- m_Timeout[n] = INFINITE;
m_ActionOnTimeout[n] = eNoAction;
m_DefaultAction[n] = eNoAction;
}
- m_Timeout[OPR_ProcessExit] = 40000;
m_ActionOnTimeout[OPR_ProcessExit] = eRudeExitProcess;
m_ActionOnTimeout[OPR_ThreadAbort] = eAbortThread;
m_ActionOnTimeout[OPR_ThreadRudeAbortInNonCriticalRegion] = eRudeAbortThread;
HandleExitProcessHelper(todo, exitCode, SCA_ExitProcessWhenShutdownComplete);
}
-
-void EEPolicy::HandleCodeContractFailure(LPCWSTR pMessage, LPCWSTR pCondition, LPCWSTR pInnerExceptionAsString)
-{
- WRAPPER_NO_CONTRACT;
-
- EEPolicy* pPolicy = GetEEPolicy();
- // GetActionOnFailure will notify the host for us.
- EPolicyAction action = pPolicy->GetActionOnFailure(FAIL_CodeContract);
- Thread* pThread = GetThread();
-
- switch(action) {
- case eThrowException:
- // Let managed code throw a ContractException (it's easier to pass the right parameters to the constructor).
- break;
- case eAbortThread:
- pThread->UserAbort(Thread::TAR_Thread, TA_Safe, GetEEPolicy()->GetTimeout(OPR_ThreadAbort), Thread::UAC_Normal);
- break;
- case eRudeAbortThread:
- pThread->UserAbort(Thread::TAR_Thread, TA_Rude, GetEEPolicy()->GetTimeout(OPR_ThreadAbort), Thread::UAC_Normal);
- break;
- case eExitProcess: // Merged w/ default case
- default:
- _ASSERTE(action == eExitProcess);
- // Since we have no exception object, make sure
- // UE tracker is clean so that RetrieveManagedBucketParameters
- // does not take any bucket details.
-#ifndef TARGET_UNIX
- pThread->GetExceptionState()->GetUEWatsonBucketTracker()->ClearWatsonBucketDetails();
-#endif // !TARGET_UNIX
- pPolicy->HandleFatalError(COR_E_CODECONTRACTFAILED, NULL, pMessage);
- break;
- }
-}
-
TA_Rude
};
- enum AppDomainUnloadTypes
- {
- ADU_Safe,
- ADU_Rude
- };
-
EEPolicy ();
DWORD GetTimeout(EClrOperation operation)
{
LIMITED_METHOD_CONTRACT;
_ASSERTE(static_cast<UINT>(operation) < MaxClrOperation);
- return m_Timeout[operation];
+ return INFINITE; // No hardcoded timeouts
}
EPolicyAction GetActionOnTimeout(EClrOperation operation, Thread *pThread)
static void HandleStackOverflow(StackOverflowDetector detector, void * pLimitFrame);
- static void HandleSoftStackOverflow(BOOL fSkipDebugger = FALSE);
-
- static void HandleStackOverflowAfterCatch();
-
static void HandleExitProcess(ShutdownCompleteAction sca = SCA_ExitProcessWhenShutdownComplete);
static int NOINLINE HandleFatalError(UINT exitCode, UINT_PTR address, LPCWSTR pMessage=NULL, PEXCEPTION_POINTERS pExceptionInfo= NULL, LPCWSTR errorSource=NULL, LPCWSTR argExceptionString=NULL);
static void HandleExitProcessFromEscalation(EPolicyAction action, UINT exitCode);
- static void HandleCodeContractFailure(LPCWSTR pMessage, LPCWSTR pCondition, LPCWSTR pInnerExceptionAsString);
-
private:
- DWORD m_Timeout[MaxClrOperation];
EPolicyAction m_ActionOnTimeout[MaxClrOperation];
EPolicyAction m_DefaultAction[MaxClrOperation];
EPolicyAction m_ActionOnFailure[MaxClrFailure];