Struct Lock

A reactor aware non-recursive simple mutex.

struct Lock ;

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

Properties

NameTypeDescription
isLocked[get] boolReturns whether the lock is currently held.
owner[get] FiberHandleReturns the FiberHandle of the current owner of the lock.

Methods

NameDescription
acquire Acquire the lock. Suspend the fiber if currently acquired.
release Release a previously acquired lock.