From b093822a4dacfe6bd36970e270f0a6d720732a04 Mon Sep 17 00:00:00 2001 From: Andrew Au Date: Thu, 13 Dec 2018 22:29:46 -0800 Subject: Setting the m_willBlockOnGarbageCollectionEvent earlier and only when we will block to avoid the async break deadlock (#21319) Setting the m_willBlockOnGarbageCollectionEvent earlier and only when we will block to avoid the async break deadlock --- src/vm/gcenv.ee.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/vm/gcenv.ee.cpp') diff --git a/src/vm/gcenv.ee.cpp b/src/vm/gcenv.ee.cpp index ff8f109f1b..98985422b0 100644 --- a/src/vm/gcenv.ee.cpp +++ b/src/vm/gcenv.ee.cpp @@ -20,16 +20,18 @@ void GCToEEInterface::SuspendEE(SUSPEND_REASON reason) _ASSERTE(reason == SUSPEND_FOR_GC || reason == SUSPEND_FOR_GC_PREP); + g_pDebugInterface->SuspendForGarbageCollectionStarted(); + ThreadSuspend::SuspendEE((ThreadSuspend::SUSPEND_REASON)reason); - g_pDebugInterface->BeforeGarbageCollection(); + g_pDebugInterface->SuspendForGarbageCollectionCompleted(); } void GCToEEInterface::RestartEE(bool bFinishedGC) { WRAPPER_NO_CONTRACT; - g_pDebugInterface->AfterGarbageCollection(); + g_pDebugInterface->ResumeForGarbageCollectionStarted(); ThreadSuspend::RestartEE(bFinishedGC, TRUE); } -- cgit v1.2.3