Skip to content

Commit c86c19f

Browse files
authored
Caching settings.pause_mode to avoid deadlock (#84189)
1 parent ba40192 commit c86c19f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/coreclr/gc/gc.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22628,6 +22628,8 @@ void gc_heap::garbage_collect_pm_full_gc()
2262822628

2262922629
void gc_heap::garbage_collect (int n)
2263022630
{
22631+
gc_pause_mode saved_settings_pause_mode = settings.pause_mode;
22632+
2263122633
//reset the number of alloc contexts
2263222634
alloc_contexts_used = 0;
2263322635

@@ -23033,7 +23035,7 @@ void gc_heap::garbage_collect (int n)
2303323035
#endif //MULTIPLE_HEAPS
2303423036

2303523037
done:
23036-
if (settings.pause_mode == pause_no_gc)
23038+
if (saved_settings_pause_mode == pause_no_gc)
2303723039
allocate_for_no_gc_after_gc();
2303823040
}
2303923041

0 commit comments

Comments
 (0)