activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r685971 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java
Date Thu, 14 Aug 2008 17:43:07 GMT
Author: rajdavies
Date: Thu Aug 14 10:43:07 2008
New Revision: 685971

URL: http://svn.apache.org/viewvc?rev=685971&view=rev
Log:
Applied patch https://issues.apache.org/activemq/browse/AMQ-1878

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java?rev=685971&r1=685970&r2=685971&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java
Thu Aug 14 10:43:07 2008
@@ -241,24 +241,12 @@
                 ((QueueBrowserSubscription)sub).incrementQueueRef();
             }
             
-//                System.out.println(new Date()+": Locked pagedInMessages: "+sub.getConsumerInfo().getConsumerId());
-//                // Add all the matching messages in the queue to the
-//                // subscription.
-//                
-//                for (QueueMessageReference node:pagedInMessages.values()){
-//                    if (!node.isDropped() && !node.isAcked() && (!node.isDropped()
||sub.getConsumerInfo().isBrowser())) {
-//                        msgContext.setMessageReference(node);
-//                        if (sub.matches(node, msgContext)) {
-//                            sub.add(node);
-//                        }
-//                    }
-//                }
-//                
-//            }
-            wakeup();
         }finally {
             dispatchLock.unlock();
         }
+        // Outside of dispatchLock() to maintain the lock hierarchy of
+        // iteratingMutex -> dispatchLock. - see https://issues.apache.org/activemq/browse/AMQ-1878
+        wakeup();
     }
 
     public void removeSubscription(ConnectionContext context, Subscription sub)
@@ -312,10 +300,12 @@
             if (consumers.isEmpty()) {
                 messages.gc();
             }
-            wakeup();
         }finally {
             dispatchLock.unlock();
         }
+        // Outside of dispatchLock() to maintain the lock hierarchy of
+        // iteratingMutex -> dispatchLock. - see https://issues.apache.org/activemq/browse/AMQ-1878
+        wakeup();
     }
 
     public void send(final ProducerBrokerExchange producerExchange, final Message message)
throws Exception {



Mime
View raw message