示例#1
0
文件: partr.c 项目: KDr2/julia
// thread function: used by all except the main thread
void jl_threadfun(void *arg)
{
    jl_threadarg_t *targ = (jl_threadarg_t*)arg;

    // initialize this thread (set tid, create heap, set up root task)
    jl_init_threadtls(targ->tid);
    void *stack_lo, *stack_hi;
    jl_init_stack_limits(0, &stack_lo, &stack_hi);
    jl_init_root_task(stack_lo, stack_hi);

    jl_ptls_t ptls = jl_get_ptls_states();
    jl_gc_state_set(ptls, JL_GC_STATE_SAFE, 0);
    uv_barrier_wait(targ->barrier);

    // free the thread argument here
    free(targ);

    (void)jl_gc_unsafe_enter(ptls);
    jl_current_task->exception = jl_nothing;
    jl_finish_task(jl_current_task, jl_nothing); // noreturn
}
示例#2
0
文件: jlapi.c 项目: iglpdc/julia
JL_DLLEXPORT int8_t (jl_gc_unsafe_enter)(void)
{
    jl_ptls_t ptls = jl_get_ptls_states();
    return jl_gc_unsafe_enter(ptls);
}
示例#3
0
文件: jlapi.c 项目: DrGar/julia
JL_DLLEXPORT int8_t (jl_gc_unsafe_enter)(void)
{
    return jl_gc_unsafe_enter();
}