@@ -334,23 +334,19 @@ PATH_cache_task::Union{Task,Nothing} = nothing
334334PATH_cache_condition:: Union{Threads.Condition, Nothing} = nothing # used for sync in tests
335335next_cache_update:: Float64 = 0.0
336336function 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
355351end
356352
0 commit comments