summaryrefslogtreecommitdiff
path: root/src/vm/threadsuspend.cpp
diff options
context:
space:
mode:
authorJan Kotas <jkotas@microsoft.com>2019-04-13 08:09:31 -0700
committerGitHub <noreply@github.com>2019-04-13 08:09:31 -0700
commit8913aaa1388e263d537b19e78caaed6b124fc0ea (patch)
treebd07a13ebfdfdb7c0537eb5969be818f3b735189 /src/vm/threadsuspend.cpp
parent0fed62e68d1f8f8a756ec8ba5348bfde61057666 (diff)
downloadcoreclr-8913aaa1388e263d537b19e78caaed6b124fc0ea.tar.gz
coreclr-8913aaa1388e263d537b19e78caaed6b124fc0ea.tar.bz2
coreclr-8913aaa1388e263d537b19e78caaed6b124fc0ea.zip
Delete COMPlus_FinalizeOnShutdown (#23595)
This compat quirk is increasingly more broken since the framework is generally not compatible with, and we have not heard anybody actually using it. Changed Environment.HasShutdownStarted to unconditionally return false. It does not make sense for it to ever return true with shutdown finalization disabled.
Diffstat (limited to 'src/vm/threadsuspend.cpp')
-rw-r--r--src/vm/threadsuspend.cpp50
1 files changed, 2 insertions, 48 deletions
diff --git a/src/vm/threadsuspend.cpp b/src/vm/threadsuspend.cpp
index 1fee3b760c..9760fe4293 100644
--- a/src/vm/threadsuspend.cpp
+++ b/src/vm/threadsuspend.cpp
@@ -1356,7 +1356,6 @@ Thread::UserAbort(ThreadAbortRequester requester,
case eExitProcess:
case eFastExitProcess:
case eRudeExitProcess:
- case eDisableRuntime:
GetEEPolicy()->NotifyHostOnDefaultAction(operation,action);
EEPolicy::HandleExitProcessFromEscalation(action, HOST_E_EXITPROCESS_THREADABORT);
_ASSERTE (!"Should not reach here");
@@ -1986,7 +1985,6 @@ LPrepareRetry:
case eExitProcess:
case eFastExitProcess:
case eRudeExitProcess:
- case eDisableRuntime:
GetEEPolicy()->NotifyHostOnTimeout(operation1, action1);
EEPolicy::HandleExitProcessFromEscalation(action1, HOST_E_EXITPROCESS_TIMEOUT);
_ASSERTE (!"Should not reach here");
@@ -2543,9 +2541,8 @@ void Thread::RareDisablePreemptiveGC()
// Note IsGCInProgress is also true for say Pause (anywhere SuspendEE happens) and GCThread is the
// thread that did the Pause. While in Pause if another thread attempts Rev/Pinvoke it should get inside the following and
// block until resume
- if (((GCHeapUtilities::IsGCInProgress() && (this != ThreadSuspend::GetSuspensionThread())) ||
- (m_State & (TS_UserSuspendPending | TS_DebugSuspendPending | TS_StackCrawlNeeded))) &&
- (!g_fSuspendOnShutdown || IsFinalizerThread() || IsShutdownSpecialThread()))
+ if ((GCHeapUtilities::IsGCInProgress() && (this != ThreadSuspend::GetSuspensionThread())) ||
+ (m_State & (TS_UserSuspendPending | TS_DebugSuspendPending | TS_StackCrawlNeeded)))
{
if (!ThreadStore::HoldingThreadStore(this))
{
@@ -2653,47 +2650,6 @@ void Thread::RareDisablePreemptiveGC()
STRESS_LOG0(LF_SYNC, LL_INFO1000, "RareDisablePreemptiveGC: leaving\n");
}
- // Block all threads except finalizer and shutdown thread during shutdown.
- // If g_fSuspendFinalizerOnShutdown is set, block the finalizer too.
- if ((g_fSuspendOnShutdown && !IsFinalizerThread() && !IsShutdownSpecialThread()) ||
- (g_fSuspendFinalizerOnShutdown && IsFinalizerThread()))
- {
- STRESS_LOG1(LF_SYNC, LL_INFO1000, "RareDisablePreemptiveGC: entering. Thread state = %x\n", m_State.Load());
-
- EnablePreemptiveGC();
-
- // Cannot use GCX_PREEMP_NO_DTOR here because we're inside of the thread
- // PREEMP->COOP switch mechanism and GCX_PREEMP's assert's will fire.
- // Instead we use BEGIN_GCX_ASSERT_PREEMP to inform Scan of the mode
- // change here.
- BEGIN_GCX_ASSERT_PREEMP;
-
-#ifdef PROFILING_SUPPORTED
- // If profiler desires GC events, notify it that this thread is waiting until the GC is over
- // Do not send suspend notifications for debugger suspensions
- {
- BEGIN_PIN_PROFILER(CORProfilerTrackSuspends());
- if (!(m_State & TS_DebugSuspendPending))
- {
- g_profControlBlock.pProfInterface->RuntimeThreadSuspended((ThreadID)this);
- }
- END_PIN_PROFILER();
- }
-#endif // PROFILING_SUPPORTED
-
-
-
- // The thread is blocked for shutdown. We do not concern for GC violation.
- CONTRACT_VIOLATION(GCViolation);
-
- WaitForEndOfShutdown();
-
- END_GCX_ASSERT_PREEMP;
-
- __SwitchToThread(INFINITE, CALLER_LIMITS_SPINNING);
- _ASSERTE(!"Cannot reach here");
- }
-
Exit: ;
END_PRESERVE_LAST_ERROR;
}
@@ -2740,7 +2696,6 @@ void Thread::HandleThreadAbortTimeout()
case eExitProcess:
case eFastExitProcess:
case eRudeExitProcess:
- case eDisableRuntime:
GetEEPolicy()->NotifyHostOnTimeout(operation,action);
EEPolicy::HandleExitProcessFromEscalation(action, HOST_E_EXITPROCESS_THREADABORT);
_ASSERTE (!"Should not reach here");
@@ -2844,7 +2799,6 @@ void Thread::PreWorkForThreadAbort()
case eExitProcess:
case eFastExitProcess:
case eRudeExitProcess:
- case eDisableRuntime:
{
GetEEPolicy()->NotifyHostOnDefaultAction(OPR_ThreadRudeAbortInCriticalRegion,action);
GetEEPolicy()->HandleExitProcessFromEscalation(action,HOST_E_EXITPROCESS_ADUNLOAD);