Skip to content

Commit 966a37d

Browse files
make require_stdlib fast path wait on package_locks
1 parent f522dc0 commit 966a37d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

base/loading.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2507,6 +2507,9 @@ function require_stdlib(uuidkey::PkgId, ext::Union{Nothing, String}=nothing)
25072507
uuidkey = PkgId(uuid5(uuidkey.uuid, ext), ext)
25082508
end
25092509
if root_module_exists(uuidkey)
2510+
lock = get(package_locks, uuidkey, nothing)
2511+
# must wait as require_lock is released around package __init__s
2512+
lock !== nothing && wait(lock[2])
25102513
return loaded_modules[uuidkey]
25112514
end
25122515
# first since this is a stdlib, try to look there directly first

0 commit comments

Comments
 (0)