All Manuals > LispWorks® User Guide and Reference Manual > 42 The MP Package

mailbox-read Function

Summary

Reads the next object in a mailbox.

Package

mp

Signature

mailbox-read mailbox &optional wait-reason timeout => object, flag

Arguments
mailbox
wait-reason
A string or nil.
timeout
A non-negative real or nil.
Values
object
An object.
flag
A boolean.
Description

The function mailbox-read returns the next object from the mailbox mailbox, or nil.

If mailbox is empty and timeout is nil, then mailbox-read blocks until an object is placed in mailbox. If mailbox is empty and timeout is a non-negative real, then mailbox-read blocks until an object is placed in mailbox or timeout seconds have passed. If the timeout occurs, then mailbox-read returns nil as the first value and also flag is nil. If an object is actually read from the mailbox, then flag is t.

wait-reason defaults to "Waiting for message in #<Mailbox...>" and will be the value returned by process-whostate while mailbox-read is blocking.

The default value of timeout is nil.

See also

mailbox-empty-p
mailbox-peek
mailbox-send
mailbox-wait-for-event
make-mailbox
19.6.3 Communication between processes and synchronization


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