TSemaphoreType

PackageAxial
A transactional semaphore, built from a transactional reference.

Specification

Kind
Type
Members
4
Examples
0
makeSignature
TSemaphore.make permits
acquireSignature
TSemaphore.acquire semaphore
releaseSignature
TSemaphore.release semaphore
availableSignature
TSemaphore.available semaphore

Summary

NameSignatureSynopsis
Operations
makeTSemaphore.make permitsCreates a transactional semaphore with the supplied initial permits.
acquireTSemaphore.acquire semaphoreAcquires a permit, retrying until one is available.
releaseTSemaphore.release semaphoreReleases a permit.
availableTSemaphore.available semaphoreReturns the number of available permits.

Operations

kind:member

make

TSemaphore.make permits
Member
Creates a transactional semaphore with the supplied initial permits.

Parameters

NameTypeDescription
permitsint

Returns

STM<TSemaphore>
kind:member

acquire

TSemaphore.acquire semaphore
Member
Acquires a permit, retrying until one is available.

Parameters

NameTypeDescription
semaphoreTSemaphore

Returns

STM<unit>
kind:member

release

TSemaphore.release semaphore
Member
Releases a permit.

Parameters

NameTypeDescription
semaphoreTSemaphore

Returns

STM<unit>
kind:member

available

TSemaphore.available semaphore
Member
Returns the number of available permits.

Parameters

NameTypeDescription
semaphoreTSemaphore

Returns

STM<int>