diff --git a/src/Curl/Multi.jl b/src/Curl/Multi.jl index 782b554..c6ed079 100644 --- a/src/Curl/Multi.jl +++ b/src/Curl/Multi.jl @@ -8,7 +8,7 @@ mutable struct Multi function Multi(grace::Integer = typemax(UInt64)) multi = new(ReentrantLock(), C_NULL, nothing, Easy[], grace) finalizer(done!, multi) - Base.@lock MULTIS_LOCK push!(filter!(m -> m.value isa Multi, MULTIS), WeakRef(multi)) + @lock MULTIS_LOCK push!(filter!(m -> m.value isa Multi, MULTIS), WeakRef(multi)) return multi end end @@ -58,7 +58,7 @@ const MULTIS = WeakRef[] # Close any Multis and their timers at exit that haven't been finalized by then Base.atexit() do while true - w = Base.@lock MULTIS_LOCK (isempty(MULTIS) ? nothing : pop!(MULTIS)) + w = @lock MULTIS_LOCK (isempty(MULTIS) ? nothing : pop!(MULTIS)) w === nothing && break w = w.value w isa Multi && done!(w) diff --git a/src/Downloads.jl b/src/Downloads.jl index 8d3cace..b3c83c3 100644 --- a/src/Downloads.jl +++ b/src/Downloads.jl @@ -13,6 +13,7 @@ for file downloading: """ module Downloads +using Base: @lock using Base.Experimental: @sync using NetworkOptions using ArgTools