activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1393733 - /activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp
Date Wed, 03 Oct 2012 19:54:16 GMT
Author: tabish
Date: Wed Oct  3 19:54:16 2012
New Revision: 1393733

URL: http://svn.apache.org/viewvc?rev=1393733&view=rev
Log:
Ensure that the close of connection trips the interrupt processing complete latch to prevent
the transport command thread from touching deleted data. 

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp?rev=1393733&r1=1393732&r2=1393733&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp
Wed Oct  3 19:54:16 2012
@@ -666,6 +666,24 @@ void ActiveMQConnection::close() {
             }
         }
 
+        // Ensure that interruption processing completes in case any consumers were
+        // still in the process when we closed them.
+        try {
+            Pointer<CountDownLatch> latch = this->config->transportInterruptionProcessingComplete;
+            if (latch != NULL) {
+                int count = latch->getCount();
+                for (; count > 0; count--) {
+                    latch->countDown();
+                }
+            }
+        } catch (Exception& error) {
+            if (!hasException) {
+                ex = error;
+                ex.setMark(__FILE__, __LINE__);
+                hasException = true;
+            }
+        }
+
         // Now inform the Broker we are shutting down.
         try {
             this->disconnect(lastDeliveredSequenceId);



Mime
View raw message