All Manuals > LispWorks® User Guide and Reference Manual > 37 The HCL Package

make-unlocked-queue

unlocked-queue-read

unlocked-queue-peek

unlocked-queue-ready

unlocked-queue-send

unlocked-queue-count

unlocked-queue-size Functions

Summary

Create and use an unlocked-queue object.

Package

hcl

Signatures

make-unlocked-queue &key size name => new-unlocked-queue

unlocked-queue-read unlocked-queue => object

unlocked-queue-peek unlocked-queue => object

unlocked-queue-ready unlocked-queue => result

unlocked-queue-send unlocked-queue object => object

unlocked-queue-count unlocked-queue => count

unlocked-queue-size unlocked-queue object => size

Arguments
size
A positive integer.
name
A Lisp object.
unlocked-queue
An unlocked-queue object.
object
A Lisp object.
Values
new-unlocked-queue
An unlocked-queue object.
object
A Lisp object.
result
A boolean.
count
A positive integer.
size
A positive integer.
Description

The function make-unlocked-queue creates a new, empty unlocked-queue object.

The functions unlocked-queue-read, unlocked-queue-peek, unlocked-queue-ready, unlocked-queue-send, unlocked-queue-count and unlocked-queue-size use an unlocked-queue object unlocked-queue.

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 new-unlocked-queue and so it is useful for debugging. name 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-peek checks whether there is anything in the queue, and if so returns the first object in the queue without modifying the queue. 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.

unlocked-queue-count returns the number of objects in the queue.

unlocked-queue-size returns the current size of the queue. Note that it is increased when needed by unlocked-queue-send.

See also

make-mailbox
unlocked-queue


LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:30:35