qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kgiu...@apache.org
Subject svn commit: r1099283 - in /qpid/trunk/qpid/cpp/src/qpid/broker: QueueFlowLimit.cpp QueueFlowLimit.h
Date Tue, 03 May 2011 22:13:52 GMT
Author: kgiusti
Date: Tue May  3 22:13:52 2011
New Revision: 1099283

URL: http://svn.apache.org/viewvc?rev=1099283&view=rev
Log:
QPID-3244: C++ broker should release flow control for a queue when it is deleted.

Modified:
    qpid/trunk/qpid/cpp/src/qpid/broker/QueueFlowLimit.cpp
    qpid/trunk/qpid/cpp/src/qpid/broker/QueueFlowLimit.h

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/QueueFlowLimit.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/QueueFlowLimit.cpp?rev=1099283&r1=1099282&r2=1099283&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/QueueFlowLimit.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/QueueFlowLimit.cpp Tue May  3 22:13:52 2011
@@ -120,6 +120,21 @@ QueueFlowLimit::QueueFlowLimit(Queue *_q
 }
 
 
+QueueFlowLimit::~QueueFlowLimit()
+{
+    sys::Mutex::ScopedLock l(indexLock);
+    if (!index.empty()) {
+        // we're gone - release all pending msgs
+        for (std::map<framing::SequenceNumber, boost::intrusive_ptr<Message> >::iterator
itr = index.begin();
+             itr != index.end(); ++itr)
+            if (itr->second)
+                try {
+                    itr->second->getIngressCompletion().finishCompleter();
+                } catch (...) {}    // ignore - not safe for a destructor to throw.
+        index.clear();
+    }
+}
+
 
 void QueueFlowLimit::enqueued(const QueuedMessage& msg)
 {

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/QueueFlowLimit.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/QueueFlowLimit.h?rev=1099283&r1=1099282&r2=1099283&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/QueueFlowLimit.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/QueueFlowLimit.h Tue May  3 22:13:52 2011
@@ -78,7 +78,7 @@ class Broker;
     static QPID_BROKER_EXTERN const std::string flowStopSizeKey;
     static QPID_BROKER_EXTERN const std::string flowResumeSizeKey;
 
-    virtual ~QueueFlowLimit() {}
+    virtual ~QueueFlowLimit();
 
     /** the queue has added QueuedMessage.  Returns true if flow state changes */
     QPID_BROKER_EXTERN void enqueued(const QueuedMessage&);



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message