acquire multimethod

Methods

acquire(l:Lock) Source: stdlib.ngs:1164
Block till the lock is avaiable and then acquire the lock.

Example

l = Lock()
...
l.acquire()
modify_global_state_safely(...)
l.release()
acquire(l:Lock, cb:Fun) Source: stdlib.ngs:1186
Call cb with lock l held. Releases the lock after cb returns or throws.

Example

l = Lock()
...
l.acquire(F() {
  modify_global_state_safely(...)
})