Skip to content

fix for DATAS assert during initialization stage #106752

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions src/coreclr/gc/gc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6999,8 +6999,21 @@ void gc_heap::gc_thread_function ()

while (1)
{
// inactive GC threads may observe gc_t_join.joined() being true here
assert ((n_heaps <= heap_number) || !gc_t_join.joined());
#ifdef DYNAMIC_HEAP_COUNT
if (gc_heap::dynamic_adaptation_mode == dynamic_adaptation_to_application_sizes)
{
// Inactive GC threads may observe gc_t_join.joined() being true here.
// Before the 1st GC happens, h0's GC thread can also observe gc_t_join.joined() being true because it's
// also inactive as the main thread (that inits the GC) will act as h0 (to call change_heap_count).
assert (((heap_number == 0) && (VolatileLoadWithoutBarrier (&settings.gc_index) == 0)) ||
(n_heaps <= heap_number) ||
!gc_t_join.joined());
}
else
#endif //DYNAMIC_HEAP_COUNT
{
assert (!gc_t_join.joined());
}

if (heap_number == 0)
{
Expand Down
Loading