wait-on-semaphore semaphore &key timeout -> generalized-boolean
Arguments and values:
semaphore -> a
timeout -> a non-negative real number.
generalized-boolean -> a generalized boolean.
Decrement the count of
semaphore by 1 if the count is larger than zero.
If the count is zero, blocks until
semaphore can be decremented.
timeout is given, it is the maximum number of seconds to wait. If
the count cannot be decremented in that time, returns
without decrementing the count.
Signals an error of type
semaphore is not a semaphore object.
Signals an error of type type-error if
timeout is neither nil nor a non-negative real number.
It is unspecified which thread gets a wakeup and does not necessarily relate to the order in which the threads went to sleep.
On Allegro, a non-null
timeout is forced to a minimum of 100ms,
because Allegro does not provide a primitive for waiting with a
timeout, which is emulated using