Semaphore

fun Semaphore(permits: Int, acquiredPermits: Int = 0): Semaphore(source)

Creates new Semaphore instance.

Parameters

permits

the number of permits available in this semaphore.

acquiredPermits

the number of already acquired permits, should be between 0 and permits (inclusively).