function empty_thread_local_caches(both_pools = true)
tp = Threads.threadpool()
Threads.@threads :static for i in 1:Threads.nthreads(tp)
empty!(_tz_cache())
end
!both_pools && return
if tp == :default
if Threads.nthreads(:interactive) > 0
fetch(@spawn :interactive empty_thread_local_caches(false))
end
else
fetch(@spawn :default empty_thread_local_caches(false))
end
end
Also, since this package uses thread-local data, you probably want to use maxthreadid()here instead of nthreads().
Due to https://github.com/JuliaLang/julia/pull/49094, the interactive thread(s) (if you start any) are now thread 1 (and up) and the default threads start after that. That breaks this assertion, which I don't think is necessary anyway?
I think this can be fixed with something like:
Also, since this package uses thread-local data, you probably want to use
maxthreadid()
here instead ofnthreads()
.