You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kg...@apache.org on 2012/03/21 22:33:25 UTC

svn commit: r1303581 - /qpid/branches/qpid-3890/qpid/cpp/src/qpid/broker/Queue.h

Author: kgiusti
Date: Wed Mar 21 21:33:24 2012
New Revision: 1303581

URL: http://svn.apache.org/viewvc?rev=1303581&view=rev
Log:
QPID-3890: add comment describing locking rules

Modified:
    qpid/branches/qpid-3890/qpid/cpp/src/qpid/broker/Queue.h

Modified: qpid/branches/qpid-3890/qpid/cpp/src/qpid/broker/Queue.h
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3890/qpid/cpp/src/qpid/broker/Queue.h?rev=1303581&r1=1303580&r2=1303581&view=diff
==============================================================================
--- qpid/branches/qpid-3890/qpid/cpp/src/qpid/broker/Queue.h (original)
+++ qpid/branches/qpid-3890/qpid/cpp/src/qpid/broker/Queue.h Wed Mar 21 21:33:24 2012
@@ -107,6 +107,22 @@ class Queue : public boost::enable_share
     QueueListeners listeners;
     std::auto_ptr<Messages> messages;
     std::deque<QueuedMessage> pendingDequeues;//used to avoid dequeuing during recovery
+    /** messageLock is used to keep the Queue's state consistent while processing message
+     * events, such as message dispatch, enqueue, acquire, and dequeue.  It must be held
+     * while updating certain members in order to keep these members consistent with
+     * each other:
+     *     o  messages
+     *     o  sequence
+     *     o  policy
+     *     o  listeners
+     *     o  allocator
+     *     o  observeXXX() methods
+     *     o  observers
+     *     o  pendingDequeues  (TBD: move under separate lock)
+     *     o  exclusive OwnershipToken (TBD: move under separate lock)
+     *     o  consumerCount  (TBD: move under separate lock)
+     *     o  Queue::UsageBarrier (TBD: move under separate lock)
+     */
     mutable qpid::sys::Monitor messageLock;
     mutable qpid::sys::Mutex ownershipLock;
     mutable uint64_t persistenceId;



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org