Skip to content

Commit

Permalink
Caching settings.pause_mode to avoid deadlock (dotnet#84189)
Browse files Browse the repository at this point in the history
  • Loading branch information
cshung committed Apr 5, 2023
1 parent ba40192 commit c86c19f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/coreclr/gc/gc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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();
}

Expand Down

0 comments on commit c86c19f

Please sign in to comment.