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