Skip to content

Commit 4cdd864

Browse files
authored
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
1 parent d4987a3 commit 4cdd864

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

base/loading.jl

+2-1
Original file line numberDiff line numberDiff line change
@@ -2397,12 +2397,13 @@ const module_keys = IdDict{Module,PkgId}() # the reverse of loaded_modules
23972397
root_module_key(m::Module) = @lock require_lock module_keys[m]
23982398

23992399
function maybe_loaded_precompile(key::PkgId, buildid::UInt128)
2400-
assert_havelock(require_lock)
2400+
@lock require_lock begin
24012401
mods = get(loaded_precompiles, key, nothing)
24022402
mods === nothing && return
24032403
for mod in mods
24042404
module_build_id(mod) == buildid && return mod
24052405
end
2406+
end
24062407
end
24072408

24082409
function module_build_id(m::Module)

0 commit comments

Comments
 (0)