Delete GetActionOnTimeout
authorJan Kotas <jkotas@microsoft.com>
Sat, 25 Apr 2020 06:44:48 +0000 (23:44 -0700)
committerJan Kotas <jkotas@microsoft.com>
Sat, 25 Apr 2020 13:53:06 +0000 (06:53 -0700)
src/coreclr/src/vm/eepolicy.cpp
src/coreclr/src/vm/eepolicy.h
src/coreclr/src/vm/threadsuspend.cpp

index 0bc68db..6cec679 100644 (file)
@@ -47,13 +47,8 @@ EEPolicy::EEPolicy ()
 
     int n;
     for (n = 0; n < MaxClrOperation; n++) {
-        m_ActionOnTimeout[n] = eNoAction;
         m_DefaultAction[n] = eNoAction;
     }
-    m_ActionOnTimeout[OPR_ProcessExit] = eRudeExitProcess;
-    m_ActionOnTimeout[OPR_ThreadAbort] = eAbortThread;
-    m_ActionOnTimeout[OPR_ThreadRudeAbortInNonCriticalRegion] = eRudeAbortThread;
-    m_ActionOnTimeout[OPR_ThreadRudeAbortInCriticalRegion] = eRudeAbortThread;
 
     m_DefaultAction[OPR_ThreadAbort] = eAbortThread;
     m_DefaultAction[OPR_ThreadRudeAbortInNonCriticalRegion] = eRudeAbortThread;
index a1e74c0..e9de4f8 100644 (file)
@@ -33,13 +33,6 @@ public:
 
     EEPolicy ();
 
-    EPolicyAction GetActionOnTimeout(EClrOperation operation, Thread *pThread)
-    {
-        WRAPPER_NO_CONTRACT;
-        _ASSERTE(static_cast<UINT>(operation) < MaxClrOperation);
-        return GetFinalAction(m_ActionOnTimeout[operation], pThread);
-    }
-
     EPolicyAction GetDefaultAction(EClrOperation operation, Thread *pThread)
     {
         WRAPPER_NO_CONTRACT;
@@ -60,7 +53,6 @@ public:
     static void HandleExitProcessFromEscalation(EPolicyAction action, UINT exitCode);
 
 private:
-    EPolicyAction m_ActionOnTimeout[MaxClrOperation];
     EPolicyAction m_DefaultAction[MaxClrOperation];
     EPolicyAction m_ActionOnFailure[MaxClrFailure];
 
index 907e4ec..e657203 100644 (file)
@@ -1382,22 +1382,10 @@ LRetry:
 
             if (now_time >= abortEndTime)
             {
-                EPolicyAction action1 = eNoAction;
-                if (fEscalation)
-                {
-                    if (!IsRudeAbort())
-                    {
-                        action1 = GetEEPolicy()->GetActionOnTimeout(OPR_ThreadAbort, this);
-                    }
-                    else
-                    {
-                        action1 = GetEEPolicy()->GetActionOnTimeout(OPR_ThreadRudeAbortInCriticalRegion, this);
-                    }
-                }
-                if (action1 == eNoAction)
+                if (!fEscalation)
                 {
                     // timeout, but no action on timeout.
-                    // Debugger can call this function to about func-eval with a timeout
+                    // Debugger can call this function to abort func-eval with a timeout
                     return HRESULT_FROM_WIN32(ERROR_TIMEOUT);
                 }
             }
@@ -2495,12 +2483,9 @@ void Thread::HandleThreadAbortTimeout()
 {
     WRAPPER_NO_CONTRACT;
 
-    EPolicyAction action = eNoAction;
-    EClrOperation operation = OPR_ThreadRudeAbortInNonCriticalRegion;
-
     if (IsFuncEvalAbort())
     {
-        // There can't be escalation policy for FuncEvalAbort timeout.
+        // There can't be escalation for FuncEvalAbort timeout.
         // The debugger should retain control of the policy.  For example, if a RudeAbort times out, it's
         // probably because the debugger had some other thread frozen.  When the thread is thawed, things might
         // be fine, so we don't want to escelate the FuncEvalRudeAbort (which will be swalled by FuncEvalHijackWorker)
@@ -2508,37 +2493,10 @@ void Thread::HandleThreadAbortTimeout()
         return;
     }
 
-    if (!IsRudeAbort())
+    if (IsRudeAbort())
     {
-        operation = OPR_ThreadAbort;
-    }
-    else
-    {
-        operation = OPR_ThreadRudeAbortInCriticalRegion;
-    }
-    action = GetEEPolicy()->GetActionOnTimeout(operation, this);
-    // We only support escalation to rude abort
-
-    EX_TRY {
-        switch (action)
-        {
-        case eRudeAbortThread:
-            MarkThreadForAbort(TAR_Thread, EEPolicy::TA_Rude);
-            break;
-        case eExitProcess:
-        case eRudeExitProcess:
-            EEPolicy::HandleExitProcessFromEscalation(action, HOST_E_EXITPROCESS_THREADABORT);
-            _ASSERTE (!"Should not reach here");
-            break;
-        case eNoAction:
-            break;
-        default:
-            _ASSERTE (!"unknown policy for thread abort");
-        }
-    }
-    EX_CATCH {
+        MarkThreadForAbort(TAR_Thread, EEPolicy::TA_Rude);
     }
-    EX_END_CATCH(SwallowAllExceptions);
 }
 
 void Thread::HandleThreadAbort ()