Skip to content

Commit

Permalink
Add top-level @sync macro to Singular module.
Browse files Browse the repository at this point in the history
  • Loading branch information
rbehrends committed Aug 21, 2020
1 parent 2a1946f commit 4086d8e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Sync.jl
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,18 @@ module Sync

end

macro sync(expr)
quote
try
Sync._lock()
$(esc(expr))
finally
Sync._unlock()
end
end
end


@static if false
eval(:(module WrapExample
display(x::Int) = println("Int: $x")
Expand Down

0 comments on commit 4086d8e

Please sign in to comment.