locks
nimony/lib/std/locks.nim
This module contains Nim's support for locks and condition vars.
type Lock = SysLockNim lock; whether this is re-entrant or not is unspecified!
type Cond = SysCondNim condition variable
func $(lock: SysLock): stringproc initLock(lock: var SysLock)Initializes the given lock.
proc deinitLock(lock: SysLock)Frees the resources associated with the lock.
proc tryAcquire(lock: var SysLock): boolTries to acquire the given lock. Returns
trueon success.proc acquire(lock: var SysLock)Acquires the given lock.
proc release(lock: var SysLock)Releases the given lock.
proc initCond(cond: var SysCond)Initializes the given condition variable.
proc deinitCond(cond: SysCond)Frees the resources associated with the condition variable.
proc wait(cond: var SysCond; lock: var SysLock)Waits on the condition variable
cond.proc signal(cond: var SysCond)Sends a signal to the condition variable
cond.proc broadcast(cond: var SysCond)Unblocks all threads currently blocked on the specified condition variable
cond.