activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1482805 - /activemq/trunk/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java
Date Wed, 15 May 2013 13:11:07 GMT
Author: chirino
Date: Wed May 15 13:11:07 2013
New Revision: 1482805

URL: http://svn.apache.org/r1482805
Log:
Reduce the amount of work done while the sendLock is acquired.

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

Modified: activemq/trunk/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java?rev=1482805&r1=1482804&r2=1482805&view=diff
==============================================================================
--- activemq/trunk/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java
(original)
+++ activemq/trunk/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java
Wed May 15 13:11:07 2013
@@ -799,12 +799,13 @@ public class Queue extends BaseDestinati
             if (!orderedWork.isEmpty()) {
 
                 ArrayList<SendSync> syncs = new ArrayList<SendSync>(orderedWork.size());;
+                for (Transaction tx : orderedWork) {
+                    syncs.add(sendSyncs.remove(tx));
+                }
                 sendLock.lockInterruptibly();
                 try {
-                    for (Transaction tx : orderedWork) {
-                        SendSync sync = sendSyncs.remove(tx);
+                    for (SendSync sync : syncs) {
                         sync.processSend();
-                        syncs.add(sync);
                     }
                 } finally {
                     sendLock.unlock();



Mime
View raw message