Skip to content

Commit e71fdda

Browse files
vtjnashIanButterworth
authored andcommitted
add require_lock call to maybe_loaded_precompile (JuliaLang#56027)
If we expect this to be a public API (https://github.com/timholy/Revise.jl for some reason is trying to access this state), we should lock around it for consistency with the other similar functions. Needed for timholy/Revise.jl#856 (cherry picked from commit 4cdd864)
1 parent ee4120f commit e71fdda

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

base/loading.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2460,12 +2460,13 @@ is_root_module(m::Module) = parentmodule(m) === m || m === Base
24602460
root_module_key(m::Module) = PkgId(m)
24612461

24622462
function maybe_loaded_precompile(key::PkgId, buildid::UInt128)
2463-
assert_havelock(require_lock)
2463+
@lock require_lock begin
24642464
mods = get(loaded_precompiles, key, nothing)
24652465
mods === nothing && return
24662466
for mod in mods
24672467
module_build_id(mod) == buildid && return mod
24682468
end
2469+
end
24692470
end
24702471

24712472
function module_build_id(m::Module)

0 commit comments

Comments
 (0)