activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1402626 - /activemq/activemq-cpp/branches/activemq-cpp-3.4.x/activemq-cpp/src/main/activemq/core/ActiveMQSessionExecutor.cpp
Date Fri, 26 Oct 2012 19:29:27 GMT
Author: tabish
Date: Fri Oct 26 19:29:26 2012
New Revision: 1402626

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

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

Modified: activemq/activemq-cpp/branches/activemq-cpp-3.4.x/activemq-cpp/src/main/activemq/core/ActiveMQSessionExecutor.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/branches/activemq-cpp-3.4.x/activemq-cpp/src/main/activemq/core/ActiveMQSessionExecutor.cpp?rev=1402626&r1=1402625&r2=1402626&view=diff
==============================================================================
--- activemq/activemq-cpp/branches/activemq-cpp-3.4.x/activemq-cpp/src/main/activemq/core/ActiveMQSessionExecutor.cpp
(original)
+++ activemq/activemq-cpp/branches/activemq-cpp-3.4.x/activemq-cpp/src/main/activemq/core/ActiveMQSessionExecutor.cpp
Fri Oct 26 19:29:26 2012
@@ -81,7 +81,7 @@ void ActiveMQSessionExecutor::executeFir
 ////////////////////////////////////////////////////////////////////////////////
 void ActiveMQSessionExecutor::wakeup() {
 
-    Pointer<TaskRunner> taskRunner = this->taskRunner;
+    Pointer<TaskRunner> taskRunner;
     synchronized( messageQueue.get() ) {
         if( this->taskRunner == NULL ) {
             this->taskRunner.reset( new DedicatedTaskRunner( this ) );
@@ -110,9 +110,17 @@ void ActiveMQSessionExecutor::stop() {
 
     if( messageQueue->isRunning() ) {
         messageQueue->stop();
-        Pointer<TaskRunner> taskRunner = this->taskRunner;
+
+        Pointer<TaskRunner> taskRunner;
+        synchronized( messageQueue.get() ) {
+        	taskRunner = this->taskRunner;
+
+            if( taskRunner != NULL ) {
+                this->taskRunner.reset( NULL );
+            }
+        }
+
         if( taskRunner != NULL ) {
-            this->taskRunner.reset( NULL );
             taskRunner->shutdown();
         }
     }



Mime
View raw message