Skip to content

Commit

Permalink
rename to :foreign
Browse files Browse the repository at this point in the history
  • Loading branch information
vchuravy committed Aug 17, 2023
1 parent c72a829 commit 273bbca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion base/task.jl
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ function enq_work(t::Task)
else
@label not_sticky
tp = Threads.threadpool(t)
if tp === :unassociated || Threads.threadpoolsize(tp) == 1
if tp === :foreign || Threads.threadpoolsize(tp) == 1
# There's only one thread in the task's assigned thread pool;
# use its work queue.
tid = (tp === :interactive) ? 1 : Threads.threadpoolsize(:interactive)+1
Expand Down
10 changes: 5 additions & 5 deletions base/threadingconstructs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function _tpid_to_sym(tpid::Int8)
elseif tpid == 1
return :default
elseif tpid == -1
return :unassociated
return :foreign
else
throw(ArgumentError("Unrecognized threadpool id $tpid"))
end
Expand All @@ -75,7 +75,7 @@ function _sym_to_tpid(tp::Symbol)
return Int8(0)
elseif tp === :default
return Int8(1)
elseif tp == :unassociated
elseif tp == :foreign
return Int8(-1)
else
throw(ArgumentError("Unrecognized threadpool name `$(repr(tp))`"))
Expand All @@ -85,7 +85,7 @@ end
"""
Threads.threadpool(tid = threadid()) -> Symbol
Returns the specified thread's threadpool; either `:default`, `:interactive`, or `:unassociated`.
Returns the specified thread's threadpool; either `:default`, `:interactive`, or `:foreign`.
"""
function threadpool(tid = threadid())
tpid = ccall(:jl_threadpoolid, Int8, (Int16,), tid-1)
Expand All @@ -112,8 +112,8 @@ See also: `BLAS.get_num_threads` and `BLAS.set_num_threads` in the
function threadpoolsize(pool::Symbol = :default)
if pool === :default || pool === :interactive
tpid = _sym_to_tpid(pool)
elseif pool == :unassociated
error("Threadpool size of `:unassociated` is indeterminant")
elseif pool == :foreign
error("Threadpool size of `:foreign` is indeterminant")
else
error("invalid threadpool specified")
end
Expand Down

0 comments on commit 273bbca

Please sign in to comment.