sb-concurrency: add Allegro-style gate objects
[sbcl.git] / contrib / sb-concurrency / queue.lisp
index 5fa7007..bf0bc98 100644 (file)
@@ -25,7 +25,9 @@
 (defstruct (queue (:constructor %make-queue (head tail name))
                   (:copier nil)
                   (:predicate queuep))
-  "Lock-free thread safe queue."
+  "Lock-free thread safe FIFO queue.
+
+Use ENQUEUE to add objects to the queue, and DEQUEUE to remove them."
   (head (error "No HEAD.") :type node)
   (tail (error "No TAIL.") :type node)
   (name nil))
@@ -117,7 +119,8 @@ and secondary value."
 
 (defun list-queue-contents (queue)
   "Returns the contents of QUEUE as a list without removing them from the
-QUEUE. Mainly useful for manual examination of queue state."
+QUEUE. Mainly useful for manual examination of queue state, as the list
+may be out of date by the time it is returned."
   (let (all)
     (labels ((walk (node)
                ;; Since NEXT pointers are always right, traversing from tail
@@ -134,7 +137,7 @@ QUEUE. Mainly useful for manual examination of queue state."
 (defun queue-count (queue)
   "Returns the number of objects in QUEUE. Mainly useful for manual
 examination of queue state, and in PRINT-OBJECT methods: inefficient as it
-walks the entire queue."
+must walk the entire queue."
   (let ((n 0))
     (declare (unsigned-byte n))
     (labels ((walk (node)