summaryrefslogtreecommitdiff
path: root/src/vm/threads.cpp
diff options
context:
space:
mode:
authorNoah Falk <noahfalk@users.noreply.github.com>2019-05-21 21:52:18 -0700
committerDavid Mason <davmason@microsoft.com>2019-05-21 21:52:18 -0700
commit671772c20a27c050df3d7d11391ea4f7de05165c (patch)
tree6e20b07feb90c3ef3b7b5bc1634e445b3c7f5f98 /src/vm/threads.cpp
parent29810a78e5b93d8da9fb921d096226d249fc75a5 (diff)
downloadcoreclr-671772c20a27c050df3d7d11391ea4f7de05165c.tar.gz
coreclr-671772c20a27c050df3d7d11391ea4f7de05165c.tar.bz2
coreclr-671772c20a27c050df3d7d11391ea4f7de05165c.zip
Fix profiler crash on shutdown (#22712)
Fixes issue #22176. Use the profiler evacuation counters to ensure that we don't callback into the profiler when it has already been released. Previously we only did this as part of the attach/detach feature, but this is required for correctness during standard shutdown given that managed threads are still running concurrently.
Diffstat (limited to 'src/vm/threads.cpp')
-rw-r--r--src/vm/threads.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/vm/threads.cpp b/src/vm/threads.cpp
index 4abc89155a..40e846bf40 100644
--- a/src/vm/threads.cpp
+++ b/src/vm/threads.cpp
@@ -1368,9 +1368,9 @@ Thread::Thread()
m_debuggerCantStop = 0;
m_fInteropDebuggingHijacked = FALSE;
m_profilerCallbackState = 0;
-#ifdef FEATURE_PROFAPI_ATTACH_DETACH
+#ifdef PROFILING_SUPPORTED
m_dwProfilerEvacuationCounter = 0;
-#endif // FEATURE_PROFAPI_ATTACH_DETACH
+#endif // PROFILING_SUPPORTED
m_pProfilerFilterContext = NULL;