From 6db0dad8f4c160a1cfd3f0d17e46ebf521ce5362 Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Thu, 17 Aug 2023 15:27:18 -0400 Subject: [PATCH] rename to :foreign --- base/task.jl | 2 +- base/threadingconstructs.jl | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/base/task.jl b/base/task.jl index 58dfe0850b40f..09b40f19f5913 100644 --- a/base/task.jl +++ b/base/task.jl @@ -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 diff --git a/base/threadingconstructs.jl b/base/threadingconstructs.jl index 5607d692db48f..a5a1294be049b 100644 --- a/base/threadingconstructs.jl +++ b/base/threadingconstructs.jl @@ -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 @@ -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))`")) @@ -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) @@ -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