X-Ref:
Lets add @lock to Compat.jl so everyone can use this
Originally posted by @omus in JuliaTime/TimeZones.jl#356 (comment)
Ref: JuliaLang/julia#36441 and JuliaLang/julia#39588
This would look something like this:
if VERSION >= v"1.3-"
using Base: @lock
else
macro lock(l, e)
quote
ll = $(esc(l));
$lock(ll);
try
$(esc(e))
finally
$unlock(ll)
end
end
end
end