acquire-timeout ( semaphore timeout -- )
Counting semaphores

Prev:acquire ( semaphore -- )
Next:release ( semaphore -- )


Vocabulary
concurrency.semaphores

Inputs
semaphorea semaphore
timeouta duration or f


Outputs
None

Word description
If the semaphore has a non-zero count, decrements it and returns immediately. Otherwise, if the timeout is f, waits indefinitely for the semaphore to be released. If the timeout is not f, waits a certain period of time, and if the semaphore still has not been released, throws an error.

Errors
Throws an error if the timeout expires before the semaphore is released.

Definition