diff options
author | Koundinya Veluri <kouvel@microsoft.com> | 2016-02-02 17:18:38 -0800 |
---|---|---|
committer | Koundinya Veluri <kouvel@microsoft.com> | 2016-02-02 18:35:32 -0800 |
commit | 7b87b346dba6ce21b81128d3b8e5c0ca2c8ab95f (patch) | |
tree | e91f2d2a73f5e0a6824e08eb2dc698ffa10bea2f | |
parent | e21ea0ad23f299e3f0a4b8584781fc9d6dab5315 (diff) | |
download | coreclr-7b87b346dba6ce21b81128d3b8e5c0ca2c8ab95f.tar.gz coreclr-7b87b346dba6ce21b81128d3b8e5c0ca2c8ab95f.tar.bz2 coreclr-7b87b346dba6ce21b81128d3b8e5c0ca2c8ab95f.zip |
Expose COMPlus_FinalizeOnShutdown in retail builds
To enable a workaround to restore the previous behavior before finalizers stopped running on shutdown by default
-rw-r--r-- | src/inc/clrconfigvalues.h | 2 | ||||
-rw-r--r-- | src/vm/finalizerthread.cpp | 12 |
2 files changed, 3 insertions, 11 deletions
diff --git a/src/inc/clrconfigvalues.h b/src/inc/clrconfigvalues.h index f876e14165..9a9f74c548 100644 --- a/src/inc/clrconfigvalues.h +++ b/src/inc/clrconfigvalues.h @@ -130,7 +130,7 @@ RETAIL_CONFIG_STRING_INFO_EX(INTERNAL_AppContextSwitchOverrides, W("AppContextSw #else #define DEFAULT_FinalizeOnShutdown (1) #endif -CONFIG_DWORD_INFO(INTERNAL_FinalizeOnShutdown, W("FinalizeOnShutdown"), DEFAULT_FinalizeOnShutdown, "When enabled, on shutdown, blocks all user threads and calls finalizers for all finalizable objects, including live objects") +RETAIL_CONFIG_DWORD_INFO(EXTERNAL_FinalizeOnShutdown, W("FinalizeOnShutdown"), DEFAULT_FinalizeOnShutdown, "When enabled, on shutdown, blocks all user threads and calls finalizers for all finalizable objects, including live objects") // // ARM 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. |