Mutable
Mutable variant of SmartMutex. With that variant you may lock and unlock. Besides, you may create Immutable variant of this instance with immutable factory
Parameters
locked
Preset state of isLocked and its internal _lockStateFlow
Functions
Link copied to clipboard
Link copied to clipboard
Holds call until this SmartMutex will be re-locked. That means that while isLocked == true, holds will wait for isLocked == false and then try to lock
Link copied to clipboard
Will try to lock this SmartMutex immediataly
Link copied to clipboard
If isLocked == true - will change it to false and return true. If current call will not unlock this SmartMutex - false
Link copied to clipboard
Will wait until the SmartMutex.lockStateFlow of this instance will be false.
Link copied to clipboard
Will call SmartMutex.Mutable.lock, then execute action and return the result after SmartMutex.Mutable.unlock