From 7b87b346dba6ce21b81128d3b8e5c0ca2c8ab95f Mon Sep 17 00:00:00 2001 From: Koundinya Veluri Date: Tue, 2 Feb 2016 17:18:38 -0800 Subject: Expose COMPlus_FinalizeOnShutdown in retail builds To enable a workaround to restore the previous behavior before finalizers stopped running on shutdown by default --- src/vm/finalizerthread.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'src/vm/finalizerthread.cpp') diff --git a/src/vm/finalizerthread.cpp b/src/vm/finalizerthread.cpp index 582e789b41..80ce9ca4c6 100644 --- a/src/vm/finalizerthread.cpp +++ b/src/vm/finalizerthread.cpp @@ -863,11 +863,7 @@ DWORD __stdcall FinalizerThread::FinalizerThreadStart(void *args) _ASSERTE(g_fEEShutDown); _ASSERTE(GetFinalizerThread()->PreemptiveGCDisabled()); - bool finalizeOnShutdown = DEFAULT_FinalizeOnShutdown != 0; -#ifdef _DEBUG - finalizeOnShutdown = CLRConfig::GetConfigValue(CLRConfig::INTERNAL_FinalizeOnShutdown) != 0; -#endif - if (finalizeOnShutdown) + if (CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_FinalizeOnShutdown) != 0) { // Finalize all registered objects during shutdown, even they are still reachable. GCHeap::GetGCHeap()->SetFinalizeQueueForShutdown(FALSE); @@ -1214,11 +1210,7 @@ BOOL FinalizerThread::FinalizerThreadWatchDog() _ASSERTE((g_fEEShutDown & ShutDown_Finalize1) || g_fFastExitProcess); - bool finalizeOnShutdown = DEFAULT_FinalizeOnShutdown != 0; -#ifdef _DEBUG - finalizeOnShutdown = CLRConfig::GetConfigValue(CLRConfig::INTERNAL_FinalizeOnShutdown) != 0; -#endif - if (finalizeOnShutdown) + if (CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_FinalizeOnShutdown) != 0) { // When running finalizers on shutdown (including for reachable objects), suspend threads for shutdown before // running finalizers, so that the reachable objects will not be used after they are finalized. -- cgit v1.2.3