Skip to content

Commit

Permalink
make work on older julia versions
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth committed Jan 12, 2024
1 parent 4712512 commit 79fbe38
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Curl/Multi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ mutable struct Multi
function Multi(grace::Integer = typemax(UInt64))
multi = new(ReentrantLock(), C_NULL, nothing, Easy[], grace)
finalizer(done!, multi)
@lock MULTIS_LOCK push!(MULTIS, WeakRef(multi))
lock(MULTIS_LOCK)
try
push!(MULTIS, WeakRef(multi))
catch
unlock(MULTIS_LOCK)

Check warning on line 15 in src/Curl/Multi.jl

View check run for this annotation

Codecov / codecov/patch

src/Curl/Multi.jl#L15

Added line #L15 was not covered by tests
end
return multi
end
end
Expand Down

0 comments on commit 79fbe38

Please sign in to comment.