activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1402621 - /activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSessionExecutor.cpp
Date Fri, 26 Oct 2012 19:25:14 GMT
Author: tabish
Date: Fri Oct 26 19:25:13 2012
New Revision: 1402621

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

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

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSessionExecutor.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSessionExecutor.cpp?rev=1402621&r1=1402620&r2=1402621&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSessionExecutor.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSessionExecutor.cpp
Fri Oct 26 19:25:13 2012
@@ -83,7 +83,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));
@@ -111,9 +111,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