Skip to content

Commit 7dcb242

Browse files
Update base/libdl.jl
Co-authored-by: Cody Tapscott <[email protected]>
1 parent afc71c7 commit 7dcb242

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

base/libdl.jl

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -341,13 +341,10 @@ Base.print(io::IO, llp::LazyLibraryPath) = print(io, string(llp))
341341

342342
# Helper to get `$(private_shlibdir)` at runtime
343343
struct PrivateShlibdirGetter; end
344-
const private_shlibdir::Ref{String} = Ref{String}()
345-
function Base.string(::PrivateShlibdirGetter)
346-
if !isassigned(private_shlibdir)
347-
private_shlibdir[] = dirname(only(filter(p -> contains(p, "libjulia-internal"), dllist())))
348-
end
349-
return private_shlibdir[]
344+
const private_shlibdir = Base.OncePerProcess{String}() do
345+
dirname(dlpath("libjulia-internal"))
350346
end
347+
Base.string(::PrivateShlibdirGetter) = private_shlibdir()
351348

352349
"""
353350
BundledLazyLibraryPath

0 commit comments

Comments
 (0)