You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2010/12/05 02:02:12 UTC

svn commit: r1042271 - /activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSessionExecutor.cpp

Author: tabish
Date: Sun Dec  5 01:02:12 2010
New Revision: 1042271

URL: http://svn.apache.org/viewvc?rev=1042271&view=rev
Log:
Perform the dispatch outside the lock to avoid a deadlock on failover.

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=1042271&r1=1042270&r2=1042271&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 Sun Dec  5 01:02:12 2010
@@ -130,12 +130,12 @@ void ActiveMQSessionExecutor::dispatch( 
             if( this->session->consumers.containsKey( dispatch->getConsumerId() ) ) {
                 consumer = this->session->consumers.get( dispatch->getConsumerId() );
             }
+        }
 
-            // If the consumer is not available, just ignore the message.
-            // Otherwise, dispatch the message to the consumer.
-            if( consumer != NULL ) {
-                consumer->dispatch( dispatch );
-            }
+        // If the consumer is not available, just ignore the message.
+        // Otherwise, dispatch the message to the consumer.
+        if( consumer != NULL ) {
+            consumer->dispatch( dispatch );
         }
 
     } catch( decaf::lang::Exception& ex ) {