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
Name | Type | Description |
---|---|---|
isLocked [get]
|
bool | Returns whether the lock is currently held. |
owner [get]
|
FiberHandle | Returns the FiberHandle of the current owner of the lock.
|
Methods
Name | Description |
---|---|
acquire
|
Acquire the lock. Suspend the fiber if currently acquired. |
release
|
Release a previously acquired lock. |