Lock

A reactor aware non-recursive simple mutex.

This struct can be used for synchronizing different fibers. It cannot be used for synchronizing threads not running under the same reactor.

Members

Functions

acquire
void acquire(Timeout timeout)

Acquire the lock. Suspend the fiber if currently acquired.

release
void release()

Release a previously acquired lock.

Properties

isLocked
bool isLocked [@property getter]

Returns whether the lock is currently held.

owner
FiberHandle owner [@property getter]

Returns the FiberHandle of the current owner of the lock.

Meta