activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r708395 - /activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQSessionExecutor.cpp
Date Tue, 28 Oct 2008 00:03:31 GMT
Author: tabish
Date: Mon Oct 27 17:03:31 2008
New Revision: 708395

URL: http://svn.apache.org/viewvc?rev=708395&view=rev
Log:
https://issues.apache.org/activemq/browse/AMQCPP-200

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

Modified: activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQSessionExecutor.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQSessionExecutor.cpp?rev=708395&r1=708394&r2=708395&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQSessionExecutor.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQSessionExecutor.cpp Mon Oct
27 17:03:31 2008
@@ -139,9 +139,9 @@
 void ActiveMQSessionExecutor::stop() {
 
     // We lock here to make sure that we wait until the thread
-    // is done with an internal dispatch operation, otherwise 
-    // we might return before that and cause the caller to be 
-    // in an inconsistant state.
+    // is done with an internal dispatch operation, otherwise
+    // we might return before that and cause the caller to be
+    // in an inconsistent state.
     synchronized( &dispatchMutex ) {
 
         if( closed || !started ) {
@@ -215,10 +215,10 @@
                 }
 
                 // When stopped we hit this case and wait otherwise
-                // if there are messages we 
-                if( messageQueue.empty() || !started ) {
+                // if there are messages we
+                if( ( messageQueue.empty() || !started ) && !closed ) {
 
-                    // Wait for more data or to be woken up.
+                    // Wait for more data or to be woke up.
                     mutex.wait();
                 }
             }
@@ -240,9 +240,9 @@
 void ActiveMQSessionExecutor::dispatchAll() {
 
     // Dispatch all currently available messages.  This lock allows the
-    // main thread to wait while we finish with a dispatch cycle, the 
+    // main thread to wait while we finish with a dispatch cycle, the
     // stop method for instance should try and lock this mutex so that
-    // it knows that we've had a chance to read the started flag and 
+    // it knows that we've had a chance to read the started flag and
     // detect that we are stopped, otherwise stop might return while
     // we are still dispatching messages.
     synchronized( &dispatchMutex ) {



Mime
View raw message