Skip to content

TimeZones.TZData.compile() fails on Julia 1.9.0-rc3 #430

Closed
@kpamnany

Description

@kpamnany

Due to JuliaLang/julia#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:

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().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions