X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=contrib%2Fsb-concurrency%2Fqueue.lisp;h=4ffe171303e149bee2d6850bb2406fcbb43d14b5;hb=54da325f13fb41669869aea688ae195426c0e231;hp=397e29e7fd20a3b5ed8cfba65c70368fa5a9223f;hpb=31fbadea3713c2024fd1ac0d881f40f44b9f0df7;p=sbcl.git diff --git a/contrib/sb-concurrency/queue.lisp b/contrib/sb-concurrency/queue.lisp index 397e29e..4ffe171 100644 --- a/contrib/sb-concurrency/queue.lisp +++ b/contrib/sb-concurrency/queue.lisp @@ -45,7 +45,7 @@ Use ENQUEUE to add objects to the queue, and DEQUEUE to remove them." (setf (documentation 'queuep 'function) "Returns true if argument is a QUEUE, NIL otherwise." (documentation 'queue-name 'function) - "Name of a QUEUE. Can be assingned to using SETF. Queue names + "Name of a QUEUE. Can be assignned to using SETF. Queue names can be arbitrary printable objects, and need not be unique.") (defun make-queue (&key name initial-contents) @@ -92,6 +92,8 @@ and secondary value." (return (values value t))))))))) (defun try-walk-queue (fun queue) + ;; This isn't /quite/ as bad as it looks. We're in danger of needing + ;; to restart only as long as we're close to the head of the queue. (let ((node (queue-head queue))) (loop (let ((value (car node))) @@ -105,8 +107,9 @@ 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, as the list -may be out of date by the time it is returned." +QUEUE. Mainly useful for manual examination of queue state, as the list may be +out of date by the time it is returned, and concurrent dequeue operations may +in the worse case force the queue-traversal to be restarted several times." (tagbody :retry (collect ((result))