@@ -129,6 +129,11 @@ void jl_parallel_gc_threadfun(void *arg)
129
129
130
130
// initialize this thread (set tid and create heap)
131
131
jl_ptls_t ptls = jl_init_threadtls (targ -> tid );
132
+ void * stack_lo , * stack_hi ;
133
+ jl_init_stack_limits (0 , & stack_lo , & stack_hi );
134
+ // warning: this changes `jl_current_task`, so be careful not to call that from this function
135
+ jl_task_t * ct = jl_init_root_task (ptls , stack_lo , stack_hi );
136
+ JL_GC_PROMISE_ROOTED (ct );
132
137
(void )jl_atomic_fetch_add_relaxed (& nrunning , -1 );
133
138
// wait for all threads
134
139
jl_gc_state_set (ptls , JL_GC_STATE_WAITING , JL_GC_STATE_UNSAFE );
@@ -158,6 +163,11 @@ void jl_concurrent_gc_threadfun(void *arg)
158
163
159
164
// initialize this thread (set tid and create heap)
160
165
jl_ptls_t ptls = jl_init_threadtls (targ -> tid );
166
+ void * stack_lo , * stack_hi ;
167
+ jl_init_stack_limits (0 , & stack_lo , & stack_hi );
168
+ // warning: this changes `jl_current_task`, so be careful not to call that from this function
169
+ jl_task_t * ct = jl_init_root_task (ptls , stack_lo , stack_hi );
170
+ JL_GC_PROMISE_ROOTED (ct );
161
171
(void )jl_atomic_fetch_add_relaxed (& nrunning , -1 );
162
172
// wait for all threads
163
173
jl_gc_state_set (ptls , JL_GC_STATE_WAITING , JL_GC_STATE_UNSAFE );
0 commit comments