commit | 794a3be3d83af94ef2fea5ad6420ef354372830b | [log] [tgz] |
---|---|---|
author | Timothy A. Bish <tabish@apache.org> | Fri Oct 26 19:29:26 2012 +0000 |
committer | Timothy A. Bish <tabish@apache.org> | Fri Oct 26 19:29:26 2012 +0000 |
tree | f6b97bc3926156270085447f657a1803fe44e7a6 | |
parent | 027532ad61fe4b35910939add0a6936a99ff0efa [diff] |
fix for: https://issues.apache.org/jira/browse/AMQCPP-437 git-svn-id: https://svn.apache.org/repos/asf/activemq/activemq-cpp/branches/activemq-cpp-3.4.x@1402626 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/activemq-cpp/src/main/activemq/core/ActiveMQSessionExecutor.cpp b/activemq-cpp/src/main/activemq/core/ActiveMQSessionExecutor.cpp index 4358657..2d7c458 100644 --- a/activemq-cpp/src/main/activemq/core/ActiveMQSessionExecutor.cpp +++ b/activemq-cpp/src/main/activemq/core/ActiveMQSessionExecutor.cpp
@@ -81,7 +81,7 @@ //////////////////////////////////////////////////////////////////////////////// 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 @@ 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(); } }