From cb44b092ee2d8f1c9422bdd9a9221198a971d29a Mon Sep 17 00:00:00 2001 From: samkaplan Date: Tue, 12 Mar 2024 17:50:01 +0000 Subject: [PATCH] work-a-round bug in Juila <1.9.2 Apparently in Julia 1.9.0 and 1.9.1, `Threads.@spawn Threads.threadpool() 1` does not work. --- src/ConcurrentUtilities.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ConcurrentUtilities.jl b/src/ConcurrentUtilities.jl index 80ecad0..3aa3af7 100644 --- a/src/ConcurrentUtilities.jl +++ b/src/ConcurrentUtilities.jl @@ -5,7 +5,7 @@ export Lockable, OrderedSynchronizer, reset!, ReadWriteLock, readlock, readunloc Pool, acquire, release, drain!, try_with_timeout, TimeoutException macro samethreadpool_spawn(expr) - if isdefined(Base.Threads, :threadpool) + if VERSION >= v"1.9.2" esc(:(Threads.@spawn Threads.threadpool() $expr)) else esc(:(Threads.@spawn $expr))