mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-15 07:43:26 +00:00
Documentation for withLock.
This commit is contained in:
@@ -56,6 +56,8 @@ proc signal*(cond: var Cond) {.inline.} =
|
||||
signalSysCond(cond)
|
||||
|
||||
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()
|
||||
{.locks: [a].}:
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user