Skip to content

Commit

Permalink
make new global for Pkg to use
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth committed Oct 15, 2023
1 parent 9c05c31 commit faa30a0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion base/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3053,6 +3053,8 @@ global parse_pidfile_hook
# the same package cannot be precompiled from different projects and/or different preferences at the same time.
compilecache_pidfile_path(pkg::PkgId) = compilecache_path(pkg, UInt64(0); project="") * ".pidfile"

const compilecache_pidlock_stale_age = 10

# Allows processes to wait if another process is precompiling a given source already.
# The lock file mtime will be updated when held every `stale_age/2` seconds.
# After `stale_age` seconds beyond the mtime of the lock file, the lock file is deleted and
Expand All @@ -3061,7 +3063,7 @@ compilecache_pidfile_path(pkg::PkgId) = compilecache_path(pkg, UInt64(0); projec
# If the lock is held by another host, it will conservatively wait `stale_age * 5`
# seconds since processes cannot be checked remotely
# NOTE: keep stale_age in-step with parallel precompile lock
function maybe_cachefile_lock(f, pkg::PkgId, srcpath::String; stale_age=10)
function maybe_cachefile_lock(f, pkg::PkgId, srcpath::String; stale_age=compilecache_pidlock_stale_age)
if @isdefined(mkpidlock_hook) && @isdefined(trymkpidlock_hook) && @isdefined(parse_pidfile_hook)
pidfile = compilecache_pidfile_path(pkg)
cachefile = invokelatest(trymkpidlock_hook, f, pidfile; stale_age)
Expand Down

0 comments on commit faa30a0

Please sign in to comment.