Skip to content

Commit

Permalink
Revert "use a fixed world for code loading (#49525)"
Browse files Browse the repository at this point in the history
This reverts commit 59bf9e8.
  • Loading branch information
DilumAluthge committed Nov 14, 2024
1 parent 2e7e3ed commit aeea0f7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 19 deletions.
1 change: 0 additions & 1 deletion base/Base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,6 @@ function __init__()
# triggering a profile via signals is not implemented on windows
start_profile_listener()
end
_require_world_age[] = get_world_counter()
# Prevent spawned Julia process from getting stuck waiting on Tracy to connect.
delete!(ENV, "JULIA_WAIT_FOR_TRACY")
if get_bool_env("JULIA_USE_FLISP_PARSER", false) === false
Expand Down
23 changes: 5 additions & 18 deletions base/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2323,8 +2323,6 @@ end
# XXX: (this is deprecated, but still used by Distributed)
const toplevel_load = Ref(true)

const _require_world_age = Ref{UInt}(typemax(UInt))

"""
require(into::Module, module::Symbol)
Expand All @@ -2347,14 +2345,6 @@ For more details regarding code loading, see the manual sections on [modules](@r
[parallel computing](@ref code-availability).
"""
function require(into::Module, mod::Symbol)
world = _require_world_age[]
if world == typemax(UInt)
world = get_world_counter()
end
return invoke_in_world(world, __require, into, mod)
end

function __require(into::Module, mod::Symbol)
if into === __toplevel__ && generating_output(#=incremental=#true)
error("`using/import $mod` outside of a Module detected. Importing a package outside of a module \
is not allowed during package precompilation.")
Expand Down Expand Up @@ -2459,14 +2449,11 @@ function collect_manifest_warnings()
return msg
end

function require(uuidkey::PkgId)
world = _require_world_age[]
if world == typemax(UInt)
world = get_world_counter()
end
return invoke_in_world(world, __require, uuidkey)
end
__require(uuidkey::PkgId) = @lock require_lock _require_prelocked(uuidkey)
# __require(uuidkey::PkgId) = @lock require_lock _require_prelocked(uuidkey)
require(uuidkey::PkgId) = @lock require_lock _require_prelocked(uuidkey)

const REPL_PKGID = PkgId(UUID("3fa0cd96-eef1-5676-8a61-b3b8758bbffb"), "REPL")

function _require_prelocked(uuidkey::PkgId, env=nothing)
assert_havelock(require_lock)
m = start_loading(uuidkey, UInt128(0), true)
Expand Down

0 comments on commit aeea0f7

Please sign in to comment.