# rlocks

Dark Mode

- Manual
- Standard library
- Index
- devel, stable

Search:
Group by:

This module contains Nim's support for reentrant locks.

# Types

    RLock = SysLock

  Nim lock, re-entrant Source Edit

# Procs

    proc initRLock(lock: var RLock) {...}{.inline, raises: [], tags: [].}

  Initializes the given lock. Source Edit

    proc deinitRLock(lock: var RLock) {...}{.inline, raises: [], tags: [].}

  Frees the resources associated with the lock. Source Edit

    proc tryAcquire(lock: var RLock): bool {...}{.raises: [], tags: [].}

  Tries to acquire the given lock. Returns `true` on success. Source Edit

    proc acquire(lock: var RLock) {...}{.raises: [], tags: [].}

  Acquires the given lock. Source Edit

    proc release(lock: var RLock) {...}{.raises: [], tags: [].}

  Releases the given lock. Source Edit

# Templates

    template withRLock(lock: var RLock; code: untyped): untyped

  Acquires the given lock and then executes the code. Source Edit