Skip to content

Commit bfb028b

Browse files
authored
fix hang in failure case (#103386)
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
1 parent 2c540e5 commit bfb028b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/coreclr/gc/gc.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -25621,8 +25621,6 @@ void gc_heap::check_heap_count ()
2562125621
// background GC is running - reset the new heap count
2562225622
dynamic_heap_count_data.new_n_heaps = n_heaps;
2562325623
dprintf (6666, ("can't change heap count! BGC in progress"));
25624-
25625-
GCToEEInterface::RestartEE(TRUE);
2562625624
}
2562725625
#endif //BACKGROUND_GC
2562825626
}
@@ -25646,6 +25644,8 @@ void gc_heap::check_heap_count ()
2564625644
dprintf (6666, ("heap count stays the same %d, no work to do, set processed sample count to %Id",
2564725645
dynamic_heap_count_data.new_n_heaps, dynamic_heap_count_data.current_samples_count));
2564825646

25647+
GCToEEInterface::RestartEE(TRUE);
25648+
2564925649
return;
2565025650
}
2565125651

0 commit comments

Comments
 (0)