From c86c19f260e6c64bbe6b0b6ad169fdda586d7573 Mon Sep 17 00:00:00 2001 From: Andrew Au Date: Wed, 5 Apr 2023 11:25:30 -0700 Subject: [PATCH] Caching settings.pause_mode to avoid deadlock (#84189) --- src/coreclr/gc/gc.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/coreclr/gc/gc.cpp b/src/coreclr/gc/gc.cpp index 5f48210..82d552d 100644 --- a/src/coreclr/gc/gc.cpp +++ b/src/coreclr/gc/gc.cpp @@ -22628,6 +22628,8 @@ void gc_heap::garbage_collect_pm_full_gc() void gc_heap::garbage_collect (int n) { + gc_pause_mode saved_settings_pause_mode = settings.pause_mode; + //reset the number of alloc contexts alloc_contexts_used = 0; @@ -23033,7 +23035,7 @@ void gc_heap::garbage_collect (int n) #endif //MULTIPLE_HEAPS done: - if (settings.pause_mode == pause_no_gc) + if (saved_settings_pause_mode == pause_no_gc) allocate_for_no_gc_after_gc(); } -- 2.7.4