Skip to content

Commit 90400ec

Browse files
authored
fix locking the Base.require_lock when using Base loading functions (#762)
1 parent f6c02d3 commit 90400ec

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/JETBase.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -893,18 +893,18 @@ function analyze_and_report_package!(interp::ConcreteInterpreter,
893893
end
894894

895895
function find_pkg(pkgname::AbstractString)
896-
pkgenv = Base.identify_package_env(pkgname)
896+
pkgenv = @lock Base.require_lock Base.identify_package_env(pkgname)
897897
isnothing(pkgenv) && error(lazy"Unknown package $pkgname.")
898898
pkgid, env = pkgenv
899-
filename = Base.locate_package(pkgid, env)
899+
filename = @lock Base.require_lock Base.locate_package(pkgid, env)
900900
isnothing(filename) && error(lazy"Expected $pkgname to have a source file.")
901901
return (; pkgid, filename)
902902
end
903903

904904
function find_pkg(pkgmod::Module)
905905
filename = pathof(pkgmod)
906906
isnothing(filename) && error(lazy"Cannot analyze a module defined in the REPL.")
907-
pkgid = Base.identify_package(String(nameof(pkgmod)))
907+
pkgid = @lock Base.require_lock Base.identify_package(String(nameof(pkgmod)))
908908
isnothing(pkgid) && error(lazy"Expected $pkgmod to exist as a package.")
909909
return (; pkgid, filename)
910910
end

0 commit comments

Comments
 (0)