Skip to content

Commit

Permalink
fix hang in failure case (#103386)
Browse files Browse the repository at this point in the history
when prepare_to_change_heap_count fails, we need to make sure to restart the EE otherwise the GC thread still holds the thread store lock
  • Loading branch information
Maoni0 authored Jun 13, 2024
1 parent 2c540e5 commit bfb028b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/coreclr/gc/gc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25621,8 +25621,6 @@ void gc_heap::check_heap_count ()
// background GC is running - reset the new heap count
dynamic_heap_count_data.new_n_heaps = n_heaps;
dprintf (6666, ("can't change heap count! BGC in progress"));

GCToEEInterface::RestartEE(TRUE);
}
#endif //BACKGROUND_GC
}
Expand All @@ -25646,6 +25644,8 @@ void gc_heap::check_heap_count ()
dprintf (6666, ("heap count stays the same %d, no work to do, set processed sample count to %Id",
dynamic_heap_count_data.new_n_heaps, dynamic_heap_count_data.current_samples_count));

GCToEEInterface::RestartEE(TRUE);

return;
}

Expand Down

0 comments on commit bfb028b

Please sign in to comment.