Skip to content

Commit

Permalink
Include world age in thread work
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyichao authored and musm committed Jan 8, 2017
1 parent 28a11ff commit a7cca5d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/threading.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,10 +399,13 @@ void ti_threadfun(void *arg)
int8_t gc_state = jl_gc_unsafe_enter(ptls);
// This is probably always NULL for now
jl_module_t *last_m = ptls->current_module;
size_t last_age = ptls->world_age;
JL_GC_PUSH1(&last_m);
ptls->current_module = work->current_module;
ptls->world_age = work->world_age;
ti_run_fun(work->args);
ptls->current_module = last_m;
ptls->world_age = last_age;
JL_GC_POP();
jl_gc_unsafe_leave(ptls, gc_state);
}
Expand Down Expand Up @@ -666,6 +669,7 @@ JL_DLLEXPORT jl_value_t *jl_threading_run(jl_svec_t *args)
threadwork.args = args;
threadwork.ret = jl_nothing;
threadwork.current_module = ptls->current_module;
threadwork.world_age = ptls->world_age;

#if PROFILE_JL_THREADING
uint64_t tcompile = uv_hrtime();
Expand Down
1 change: 1 addition & 0 deletions src/threading.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ typedef struct {
jl_svec_t *args;
jl_value_t *ret;
jl_module_t *current_module;
size_t world_age;
} ti_threadwork_t;

// thread function
Expand Down

0 comments on commit a7cca5d

Please sign in to comment.