Create and use an unlocked-queue object.
make-unlocked-queue &key size name => unlocked-queue
unlocked-queue-read unlocked-queue => object
The function make-unlocked-queue
creates a new, empty unlocked-queue object.
The functions unlocked-queue-read
, unlocked-queue-ready
and unlocked-queue-send
use an unlocked-queue object.
size is a hint of the maximum number of objects that are expected to be in the queue simultaneously. The queue is extended as needed, so size does not have to be a good guess.
name is used when printing the unlocked-queue and so it is useful for debugging. size is not used otherwise.
unlocked-queue-read
checks whether there is anything in the queue, and if so removes the first object in the queue and returns it. Otherwise it returns nil
.
unlocked-queue-ready
returns a boolean specifying whether there is anything in the queue.
unlocked-queue-send
adds object to the end of the queue, extending the queue if needed. It returns its second argument.
LispWorks User Guide and Reference Manual - 13 Feb 2015