activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1394110 - /activemq/activemq-cpp/branches/activemq-cpp-3.4.x/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp
Date Thu, 04 Oct 2012 15:06:39 GMT
Author: tabish
Date: Thu Oct  4 15:06:39 2012
New Revision: 1394110

URL: http://svn.apache.org/viewvc?rev=1394110&view=rev
Log:
fix for: https://issues.apache.org/jira/browse/AMQCPP-432

Modified:
    activemq/activemq-cpp/branches/activemq-cpp-3.4.x/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp

Modified: activemq/activemq-cpp/branches/activemq-cpp-3.4.x/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/branches/activemq-cpp-3.4.x/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp?rev=1394110&r1=1394109&r2=1394110&view=diff
==============================================================================
--- activemq/activemq-cpp/branches/activemq-cpp-3.4.x/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp
(original)
+++ activemq/activemq-cpp/branches/activemq-cpp-3.4.x/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp
Thu Oct  4 15:06:39 2012
@@ -199,6 +199,13 @@ namespace core{
             this->scheduler->start();
         }
 
+        ~ConnectionConfig() {
+        	try {
+        		this->scheduler->shutdown();
+        	}
+        	AMQ_CATCHALL_NOTHROW()
+        }
+
         void waitForBrokerInfo() {
             this->brokerInfoReceived->await();
         }
@@ -474,6 +481,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;
+            }
+        }
+
         // Once current deliveries are done this stops the delivery
         // of any new messages.
         this->started.set(false);



Mime
View raw message