File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -6999,8 +6999,21 @@ void gc_heap::gc_thread_function ()
6999
6999
7000
7000
while (1)
7001
7001
{
7002
- // inactive GC threads may observe gc_t_join.joined() being true here
7003
- assert ((n_heaps <= heap_number) || !gc_t_join.joined());
7002
+ #ifdef DYNAMIC_HEAP_COUNT
7003
+ if (gc_heap::dynamic_adaptation_mode == dynamic_adaptation_to_application_sizes)
7004
+ {
7005
+ // Inactive GC threads may observe gc_t_join.joined() being true here.
7006
+ // Before the 1st GC happens, h0's GC thread can also observe gc_t_join.joined() being true because it's
7007
+ // also inactive as the main thread (that inits the GC) will act as h0 (to call change_heap_count).
7008
+ assert (((heap_number == 0) && (VolatileLoadWithoutBarrier (&settings.gc_index) == 0)) ||
7009
+ (n_heaps <= heap_number) ||
7010
+ !gc_t_join.joined());
7011
+ }
7012
+ else
7013
+ #endif //DYNAMIC_HEAP_COUNT
7014
+ {
7015
+ assert (!gc_t_join.joined());
7016
+ }
7004
7017
7005
7018
if (heap_number == 0)
7006
7019
{
You can’t perform that action at this time.
0 commit comments