Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/task.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,11 @@ void JL_NORETURN jl_finish_task(jl_task_t *t)
ct->ptls->in_pure_callback = 0;
ct->world_age = jl_atomic_load_acquire(&jl_world_counter);
// let the runtime know this task is dead and find a new task to run

// Empty out the closure and the task local state so that GC can free those values.
ct->start = jl_nothing;
ct->tls = jl_nothing;

jl_function_t *done = jl_atomic_load_relaxed(&task_done_hook_func);
if (done == NULL) {
done = (jl_function_t*)jl_get_global(jl_base_module, jl_symbol("task_done_hook"));
Expand Down
2 changes: 1 addition & 1 deletion stdlib/Serialization/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ create_serialization_stream() do s # user-defined type array
serialize(s, t)
seek(s, 0)
r = deserialize(s)
@test r.storage[:v] == 2
@test r.storage == nothing
@test r.state === :done
@test r.exception === nothing
end
Expand Down