W3cubDocs

/Nim

Module rlocks

This module contains Nim's support for reentrant locks.

Types

RLock = SysLock
Nim lock, re-entrant

Procs

proc initRLock(lock: var RLock) {...}{.inline, raises: [], tags: [].}
Initializes the given lock.
proc deinitRLock(lock: var RLock) {...}{.inline, raises: [], tags: [].}
Frees the resources associated with the lock.
proc tryAcquire(lock: var RLock): bool {...}{.raises: [], tags: [].}
Tries to acquire the given lock. Returns true on success.
proc acquire(lock: var RLock) {...}{.raises: [], tags: [].}
Acquires the given lock.
proc release(lock: var RLock) {...}{.raises: [], tags: [].}
Releases the given lock.

Templates

template withRLock(lock: var RLock; code: untyped): untyped
Acquires the given lock and then executes the code.

© 2006–2018 Andreas Rumpf
Licensed under the MIT License.
https://nim-lang.org/docs/rlocks.html