Skip to content

Commit

Permalink
suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth committed Jan 12, 2024
1 parent ab8a69a commit 410408d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Curl/Multi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions src/Downloads.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ for file downloading:
"""
module Downloads

using Base: @lock
using Base.Experimental: @sync
using NetworkOptions
using ArgTools
Expand Down

0 comments on commit 410408d

Please sign in to comment.