Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix external IO loop thead interaction and add function to Base.Experimental to facilitate it's use. Also add a test. #55529

Merged
merged 10 commits into from
Nov 7, 2024
1 change: 1 addition & 0 deletions src/threading.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ JL_DLLEXPORT jl_gcframe_t **jl_adopt_thread(void)
JL_GC_PROMISE_ROOTED(ct);
uv_random(NULL, NULL, &ct->rngState, sizeof(ct->rngState), 0, NULL);
jl_atomic_fetch_add(&jl_gc_disable_counter, -1);
ct->world_age = jl_get_world_counter(); // root_task sets world_age to 1
vtjnash marked this conversation as resolved.
Show resolved Hide resolved
jl_init_task_lock(ct);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this really needed for all adopted threads? Could we lazy initialize it when somebody tries to wait for the task instead?

return &ct->gcstack;
}
Expand Down