fixes #6049 add mixin release, acquire to withLock (#6113)

This commit is contained in:
andri lim
2017-07-16 21:54:09 +07:00
committed by Andreas Rumpf
parent 4846ce0f41
commit 2ecdf582a8
3 changed files with 22 additions and 0 deletions

View File

@@ -59,6 +59,7 @@ proc signal*(cond: var Cond) {.inline.} =
template withLock*(a: Lock, body: untyped) =
## Acquires the given lock, executes the statements in body and
## releases the lock after the statements finish executing.
mixin acquire, release
a.acquire()
{.locks: [a].}:
try: