@@ -122,6 +122,12 @@ void jl_gc_mark_threadfun(void *arg)
122
122
// initialize this thread (set tid and create heap)
123
123
jl_ptls_t ptls = jl_init_threadtls (targ -> tid );
124
124
125
+ void * stack_lo , * stack_hi ;
126
+ jl_init_stack_limits (0 , & stack_lo , & stack_hi );
127
+ // warning: this changes `jl_current_task`, so be careful not to call that from this function
128
+ jl_task_t * ct = jl_init_root_task (ptls , stack_lo , stack_hi );
129
+ JL_GC_PROMISE_ROOTED (ct );
130
+
125
131
// wait for all threads
126
132
jl_gc_state_set (ptls , JL_GC_STATE_WAITING , 0 );
127
133
uv_barrier_wait (targ -> barrier );
@@ -147,6 +153,12 @@ void jl_gc_sweep_threadfun(void *arg)
147
153
// initialize this thread (set tid and create heap)
148
154
jl_ptls_t ptls = jl_init_threadtls (targ -> tid );
149
155
156
+ void * stack_lo , * stack_hi ;
157
+ jl_init_stack_limits (0 , & stack_lo , & stack_hi );
158
+ // warning: this changes `jl_current_task`, so be careful not to call that from this function
159
+ jl_task_t * ct = jl_init_root_task (ptls , stack_lo , stack_hi );
160
+ JL_GC_PROMISE_ROOTED (ct );
161
+
150
162
// wait for all threads
151
163
jl_gc_state_set (ptls , JL_GC_STATE_WAITING , 0 );
152
164
uv_barrier_wait (targ -> barrier );
0 commit comments