# Immutable

class Immutable (val permitsStateFlow: StateFlow< Int >, val maxPermits: Int ) : SmartSemaphore (source)

Immutable variant of SmartSemaphore. In fact will depend on the owner of permitsStateFlow

## Constructors

Immutable
Link copied to clipboard
constructor(permitsStateFlow: StateFlow< Int >, maxPermits: Int )

## Properties

freePermits
Link copied to clipboard
open val freePermits : Int
maxPermits
Link copied to clipboard
open override val maxPermits : Int
permitsStateFlow
Link copied to clipboard
open override val permitsStateFlow : StateFlow< Int >

## Functions

waitRelease
Link copied to clipboard
suspend fun SmartSemaphore . waitRelease (permits: Int = 1): Int

Will wait until the SmartSemaphore.permitsStateFlow of this instance will have permits count free permits.

waitReleaseAll
Link copied to clipboard
suspend fun SmartSemaphore . waitReleaseAll (): Int