wait-on-semaphore semaphore &key timeout -> generalized-boolean
Arguments and values:
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.
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