The safe-queue Reference Manual

This is the safe-queue Reference Manual, version 0.2, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Feb 26 17:49:50 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 safe-queue

Thread-safe queue and mailbox

Maintainer

Ilya Khaprov <>

Author

3b

License

MIT

Version

0.2

Dependencies
  • split-sequence (system).
  • sb-concurrency (system).
Source

safe-queue.asd.

Child Components

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


3.1 Lisp


3.1.1 safe-queue/safe-queue.asd

Source

safe-queue.asd.

Parent Component

safe-queue (system).

ASDF Systems

safe-queue.

Packages

safe-queue-system.


3.1.2 safe-queue/src/package.lisp

Source

safe-queue.asd.

Parent Component

safe-queue (system).

Packages

safe-queue.


3.1.3 safe-queue/src/sb-concurrency-patch.lisp

Dependency

src/package.lisp (file).

Source

safe-queue.asd.

Parent Component

safe-queue (system).


3.1.4 safe-queue/src/concurrency-sbcl.lisp

Dependency

src/sb-concurrency-patch.lisp (file).

Source

safe-queue.asd.

Parent Component

safe-queue (system).

Public Interface
Internals

mailboxp (function).


4 Packages

Packages are listed by definition order.


4.1 safe-queue

Source

src/package.lisp.

Use List

common-lisp.

Public Interface
Internals

mailboxp (function).


4.2 safe-queue-system

Source

safe-queue.asd.

Use List
  • asdf/interface.
  • common-lisp.

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


5.1 Public Interface


5.1.1 Ordinary functions

Function: dequeue (queue)

Retrieves the oldest value in QUEUE and returns it as the primary value, and T as secondary value. If the queue is empty, returns NIL as both primary and secondary value.

Package

safe-queue.

Source

src/concurrency-sbcl.lisp.

Function: enqueue (value queue)

Adds VALUE to the end of QUEUE. Returns VALUE.

Package

safe-queue.

Source

src/concurrency-sbcl.lisp.

Function: mailbox-count (mailbox)

Returns the number of messages currently in the MAILBOX.

Package

safe-queue.

Source

src/concurrency-sbcl.lisp.

Function: mailbox-empty-p (mailbox)

Returns true if MAILBOX is currently empty, NIL otherwise.

Package

safe-queue.

Source

src/concurrency-sbcl.lisp.

Function: mailbox-list-messages (mailbox)

Returns a fresh list containing all the messages in the mailbox. Does not remove messages from the mailbox.

Package

safe-queue.

Source

src/concurrency-sbcl.lisp.

Function: mailbox-receive-message (mailbox &key timeout)

Removes the oldest message from MAILBOX and returns it as the primary value. If MAILBOX is empty waits until a message arrives.

Package

safe-queue.

Source

src/concurrency-sbcl.lisp.

Function: mailbox-receive-message-no-hang (mailbox)

The non-blocking variant of RECEIVE-MESSAGE. Returns two values, the message removed from MAILBOX, and a flag specifying whether a message could be received.

Package

safe-queue.

Source

src/concurrency-sbcl.lisp.

Function: mailbox-receive-pending-messages (mailbox &optional n)

Removes and returns all (or at most N) currently pending messages from MAILBOX, or returns NIL if no messages are pending.

Note: Concurrent threads may be snarfing messages during the run of this function, so even though X,Y appear right next to each other in the result, does not necessarily mean that Y was the message sent right after X.

Package

safe-queue.

Source

src/concurrency-sbcl.lisp.

Function: mailbox-send-message (mailbox message)

Adds a MESSAGE to MAILBOX. Message can be any object.

Package

safe-queue.

Source

src/concurrency-sbcl.lisp.

Function: make-mailbox (&key name initial-contents)

Returns a new MAILBOX with messages in INITIAL-CONTENTS enqueued.

Package

safe-queue.

Source

src/concurrency-sbcl.lisp.

Function: make-queue (&key name initial-contents)

Returns a new QUEUE with NAME and contents of the INITIAL-CONTENTS sequence enqueued.

Package

safe-queue.

Source

src/concurrency-sbcl.lisp.

Function: queue-count (queue)

Returns the number of messages currently in the QUEUE.

Package

safe-queue.

Source

src/concurrency-sbcl.lisp.

Function: queue-empty-p (queue)

Returns true if QUEUE is currently empty, NIL otherwise.

Package

safe-queue.

Source

src/concurrency-sbcl.lisp.


5.1.2 Types

Type: mailbox ()
Package

safe-queue.

Source

src/concurrency-sbcl.lisp.

Type: queue ()
Package

safe-queue.

Source

src/concurrency-sbcl.lisp.


5.2 Internals


5.2.1 Ordinary functions

Function: mailboxp (mailbox)

Returns true if MAILBOX is currently empty, NIL otherwise.

Package

safe-queue.

Source

src/concurrency-sbcl.lisp.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   D   E   F   M   Q  
Index Entry  Section

D
dequeue: Public ordinary functions

E
enqueue: Public ordinary functions

F
Function, dequeue: Public ordinary functions
Function, enqueue: Public ordinary functions
Function, mailbox-count: Public ordinary functions
Function, mailbox-empty-p: Public ordinary functions
Function, mailbox-list-messages: Public ordinary functions
Function, mailbox-receive-message: Public ordinary functions
Function, mailbox-receive-message-no-hang: Public ordinary functions
Function, mailbox-receive-pending-messages: Public ordinary functions
Function, mailbox-send-message: Public ordinary functions
Function, mailboxp: Private ordinary functions
Function, make-mailbox: Public ordinary functions
Function, make-queue: Public ordinary functions
Function, queue-count: Public ordinary functions
Function, queue-empty-p: Public ordinary functions

M
mailbox-count: Public ordinary functions
mailbox-empty-p: Public ordinary functions
mailbox-list-messages: Public ordinary functions
mailbox-receive-message: Public ordinary functions
mailbox-receive-message-no-hang: Public ordinary functions
mailbox-receive-pending-messages: Public ordinary functions
mailbox-send-message: Public ordinary functions
mailboxp: Private ordinary functions
make-mailbox: Public ordinary functions
make-queue: Public ordinary functions

Q
queue-count: Public ordinary functions
queue-empty-p: Public ordinary functions


A.3 Variables