Smart Semaphore
It is interface which will work like classic Semaphore, but in difference have permitsStateFlow for listening of the SmartSemaphore state.
There is Mutable and Immutable realizations. In case you are owner and manager current state of lock, you need Mutable. Otherwise, Immutable.
Any Mutable may produce its Immutable variant which will contains permitsStateFlow equal to its Mutable creator
Inheritors
Types
Link copied to clipboard
Immutable variant of SmartSemaphore. In fact will depend on the owner of permitsStateFlow
Link copied to clipboard
Mutable variant of SmartSemaphore. With that variant you may lock and unlock. Besides, you may create Immutable variant of this instance with immutable factory
Functions
Link copied to clipboard
Will wait until the SmartSemaphore.permitsStateFlow of this instance will have permits count free permits.