Documentation for withLock.

This commit is contained in:
Dominik Picheta 2016-03-23 12:47:05 +00:00
commit 34401a3639

View file

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