Mutable
Mutable variant of SmartSemaphore. 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 freePermits and its internal _freePermitsStateFlow
Properties
Functions
Link copied to clipboard
Holds call until this SmartSemaphore will be re-locked. That means that current method will
Link copied to clipboard
Link copied to clipboard
If freePermits == true - will change it to false and return true. If current call will not unlock this SmartSemaphore - false
Link copied to clipboard
Will try to lock this SmartSemaphore immediataly
Link copied to clipboard
Will wait until the SmartSemaphore.permitsStateFlow of this instance will have permits count free permits.
Link copied to clipboard
Link copied to clipboard
Will call SmartSemaphore.Mutable.lock, then execute action and return the result after SmartSemaphore.Mutable.unlock