Skip to content

Commit

Permalink
Merge pull request #14565 from JuliaLang/yyc/gc/state-init
Browse files Browse the repository at this point in the history
Explicitly initialize GC state
  • Loading branch information
JeffBezanson committed Jan 5, 2016
2 parents 45efa5d + 9f57264 commit 8fb848a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/threading.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,17 @@ struct _jl_thread_heap_t *jl_mk_thread_heap(void);

static void ti_initthread(int16_t tid)
{
ti_tid = tid;
jl_pgcstack = NULL;
jl_tls_states_t *ptls = jl_get_ptls_states();
ptls->tid = tid;
ptls->pgcstack = NULL;
ptls->gc_state = 0; // GC unsafe
#ifdef JULIA_ENABLE_THREADING
jl_all_heaps[tid] = jl_mk_thread_heap();
#else
jl_mk_thread_heap();
#endif

jl_all_task_states[tid].ptls = jl_get_ptls_states();
jl_all_task_states[tid].ptls = ptls;
jl_all_task_states[tid].signal_stack = jl_install_thread_signal_handler();
}

Expand Down

0 comments on commit 8fb848a

Please sign in to comment.