Skip to content

Commit

Permalink
fix #50438, use default pool for at-threads (#50845)
Browse files Browse the repository at this point in the history
(cherry picked from commit 744aa79)
  • Loading branch information
JeffBezanson authored and KristofferC committed Aug 10, 2023
1 parent 593dcde commit 7a5d1d4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion base/threadingconstructs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,13 @@ function threading_run(fun, static)
for i = 1:n
t = Task(() -> fun(i)) # pass in tid
t.sticky = static
static && ccall(:jl_set_task_tid, Cint, (Any, Cint), t, tid_offset + i-1)
if static
ccall(:jl_set_task_tid, Cint, (Any, Cint), t, tid_offset + i-1)
else
# TODO: this should be the current pool (except interactive) if there
# are ever more than two pools.
ccall(:jl_set_task_threadpoolid, Cint, (Any, Int8), t, _sym_to_tpid(:default))
end
tasks[i] = t
schedule(t)
end
Expand Down

0 comments on commit 7a5d1d4

Please sign in to comment.