Skip to content

Commit 71cf71d

Browse files
committed
add an assertion to ensure we're not cleaning-up GC state for GC threads
1 parent c6d079c commit 71cf71d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/gc.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3715,8 +3715,9 @@ static int _jl_gc_collect(jl_ptls_t ptls, jl_gc_collection_t collection)
37153715
}
37163716
// free empty GC state for threads that have exited
37173717
if (jl_atomic_load_relaxed(&ptls2->current_task) == NULL) {
3718-
if (gc_is_parallel_collector_thread(t_i))
3719-
continue;
3718+
// GC threads should never exit
3719+
assert(!gc_is_parallel_collector_thread(t_i));
3720+
assert(!gc_is_concurrent_collector_thread(t_i));
37203721
jl_thread_heap_t *heap = &ptls2->gc_tls.heap;
37213722
if (heap->weak_refs.len == 0)
37223723
small_arraylist_free(&heap->weak_refs);

0 commit comments

Comments
 (0)