Skip to content

Commit 96423ba

Browse files
committed
Revert "REPL: improve type inference for maybe_spawn_cache_PATH (#59144)"
This reverts commit 19f000f.
1 parent e437a5a commit 96423ba

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

stdlib/REPL/src/REPLCompletions.jl

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -334,23 +334,19 @@ PATH_cache_task::Union{Task,Nothing} = nothing
334334
PATH_cache_condition::Union{Threads.Condition, Nothing} = nothing # used for sync in tests
335335
next_cache_update::Float64 = 0.0
336336
function maybe_spawn_cache_PATH()
337-
global PATH_cache_task, PATH_cache_condition, next_cache_update
338-
# Extract to local variables to enable flow-sensitive type inference for these global variables
339-
PATH_cache_task_local = PATH_cache_task
340-
PATH_cache_condition_local = PATH_cache_condition
337+
global PATH_cache_task, next_cache_update
341338
@lock PATH_cache_lock begin
342-
PATH_cache_task_local isa Task && !istaskdone(PATH_cache_task_local) && return
339+
PATH_cache_task isa Task && !istaskdone(PATH_cache_task) && return
343340
time() < next_cache_update && return
344341
PATH_cache_task = Threads.@spawn begin
345342
REPLCompletions.cache_PATH()
346343
@lock PATH_cache_lock begin
347344
next_cache_update = time() + 10 # earliest next update can run is 10s after
348345
PATH_cache_task = nothing # release memory when done
349-
PATH_cache_condition_local !== nothing && notify(PATH_cache_condition_local)
346+
PATH_cache_condition !== nothing && notify(PATH_cache_condition)
350347
end
351348
end
352-
PATH_cache_task_local = PATH_cache_task
353-
Base.errormonitor(PATH_cache_task_local)
349+
Base.errormonitor(PATH_cache_task)
354350
end
355351
end
356352

0 commit comments

Comments
 (0)