qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject svn commit: r1156266 - in /qpid/trunk/qpid/cpp/src/qpid: broker/DirectExchange.cpp sys/CopyOnWriteArray.h
Date Wed, 10 Aug 2011 17:07:22 GMT
Author: gsim
Date: Wed Aug 10 17:07:21 2011
New Revision: 1156266

URL: http://svn.apache.org/viewvc?rev=1156266&view=rev
Log:
QPID-3403: Remove empty binding list from map

Modified:
    qpid/trunk/qpid/cpp/src/qpid/broker/DirectExchange.cpp
    qpid/trunk/qpid/cpp/src/qpid/sys/CopyOnWriteArray.h

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/DirectExchange.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/DirectExchange.cpp?rev=1156266&r1=1156265&r2=1156266&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/DirectExchange.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/DirectExchange.cpp Wed Aug 10 17:07:21 2011
@@ -139,6 +139,9 @@ bool DirectExchange::unbind(Queue::share
             if (mgmtExchange != 0) {
                 mgmtExchange->dec_bindingCount();
             }
+            if (bk.queues.empty()) {
+                bindings.erase(routingKey);
+            }
         } else {
             return false;
         }

Modified: qpid/trunk/qpid/cpp/src/qpid/sys/CopyOnWriteArray.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/sys/CopyOnWriteArray.h?rev=1156266&r1=1156265&r2=1156266&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/sys/CopyOnWriteArray.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/sys/CopyOnWriteArray.h Wed Aug 10 17:07:21 2011
@@ -43,6 +43,12 @@ public:
     CopyOnWriteArray() {}
     CopyOnWriteArray(const CopyOnWriteArray& c) : array(c.array) {}
 
+    bool empty()
+    {
+        Mutex::ScopedLock l(lock);
+        return array->empty();
+    }
+
     void add(T& t)
     {
         Mutex::ScopedLock l(lock);



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


Mime
View raw message