semaphoreΒΆ
type semaphoreA semaphore for synchronizing concurrent code.
fun semaphore(Initial?: integer): semaphoreReturns a new semaphore with initial value
Initialor1if no initial value is specified.meth (Semaphore: semaphore):signal: integerIncrements the internal value in
Semaphore, resuming any waiters. Returns the new value.meth (Semaphore: semaphore):value: integerReturns the internal value in
Semaphore.meth (Semaphore: semaphore):wait: integerWaits until the internal value in
Semaphoreis postive, then decrements it and returns the new value.