Skip to content

Commit e22d308

Browse files
JeffBezansonKristofferC
authored andcommitted
fix #50438, use default pool for at-threads (#50845)
(cherry picked from commit 744aa79)
1 parent c5e7846 commit e22d308

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

base/threadingconstructs.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,13 @@ function threading_run(fun, static)
146146
for i = 1:n
147147
t = Task(() -> fun(i)) # pass in tid
148148
t.sticky = static
149-
static && ccall(:jl_set_task_tid, Cint, (Any, Cint), t, tid_offset + i-1)
149+
if static
150+
ccall(:jl_set_task_tid, Cint, (Any, Cint), t, tid_offset + i-1)
151+
else
152+
# TODO: this should be the current pool (except interactive) if there
153+
# are ever more than two pools.
154+
ccall(:jl_set_task_threadpoolid, Cint, (Any, Int8), t, _sym_to_tpid(:default))
155+
end
150156
tasks[i] = t
151157
schedule(t)
152158
end

0 commit comments

Comments
 (0)