Skip to content

Commit 157ab5a

Browse files
vtjnashKristofferC
authored andcommitted
add require_lock call to maybe_loaded_precompile (#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 5a280aa commit 157ab5a

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
@@ -2417,12 +2417,13 @@ is_root_module(m::Module) = @lock require_lock haskey(module_keys, m)
24172417
root_module_key(m::Module) = @lock require_lock module_keys[m]
24182418

24192419
function maybe_loaded_precompile(key::PkgId, buildid::UInt128)
2420-
assert_havelock(require_lock)
2420+
@lock require_lock begin
24212421
mods = get(loaded_precompiles, key, nothing)
24222422
mods === nothing && return
24232423
for mod in mods
24242424
module_build_id(mod) == buildid && return mod
24252425
end
2426+
end
24262427
end
24272428

24282429
function module_build_id(m::Module)

0 commit comments

Comments
 (0)