diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2017-09-15 09:27:51 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2017-09-15 09:27:51 +0200 |
commit | 39f0195ebf30cc9f4b96953423298d7a2130eac8 (patch) | |
tree | bb4daf580c239b59d232e186814b69fc642ce6d5 /lib/core/locks.nim | |
parent | bc738d63a728ee6030cc224c8808990a6f641feb (diff) | |
parent | 2ef65d5cdf3d65cbfab4c39796ddb4e70e9ebb37 (diff) | |
download | Nim-39f0195ebf30cc9f4b96953423298d7a2130eac8.tar.gz |
Merge branch 'devel' into araq
Diffstat (limited to 'lib/core/locks.nim')
-rw-r--r-- | lib/core/locks.nim | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/core/locks.nim b/lib/core/locks.nim index fbe9c8acf..f9add0037 100644 --- a/lib/core/locks.nim +++ b/lib/core/locks.nim @@ -19,6 +19,8 @@ type {.deprecated: [TLock: Lock, TCond: Cond].} +{.push stackTrace: off.} + proc initLock*(lock: var Lock) {.inline.} = ## Initializes the given lock. initSysLock(lock) @@ -59,9 +61,12 @@ 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: body finally: a.release() + +{.pop.} |