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

Add jl_getaffinity and jl_setaffinity #53402

Merged
merged 18 commits into from
May 25, 2024
Merged
Prev Previous commit
Next Next commit
fix
  • Loading branch information
carstenbauer committed Apr 17, 2024
commit a53ea15618e0e5ff019fe709e20f379e05c05532
4 changes: 2 additions & 2 deletions src/threading.c
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,7 @@ JL_DLLEXPORT int jl_getaffinity(int16_t tid, char *mask, int cpumasksize) {
if (tid < 0 || tid >= nthreads)
jl_error("invalid tid");

jl_ptls_t *ptls2 = jl_atomic_load_relaxed(&jl_all_tls_states)[tid];
jl_ptls_t ptls2 = jl_atomic_load_relaxed(&jl_all_tls_states)[tid];
uv_thread_t uvtid = ptls2->system_id;

// returns 0 in case of success and a value != 0 otherwise
Expand All @@ -1001,7 +1001,7 @@ JL_DLLEXPORT int jl_setaffinity(int16_t tid, char *mask, int cpumasksize) {
if (tid < 0 || tid >= nthreads)
jl_error("invalid tid");

jl_ptls_t *ptls2 = jl_atomic_load_relaxed(&jl_all_tls_states)[tid];
jl_ptls_t ptls2 = jl_atomic_load_relaxed(&jl_all_tls_states)[tid];
uv_thread_t uvtid = ptls2->system_id;

// returns 0 in case of success and a value != 0 otherwise
Expand Down