You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2013/05/15 15:11:07 UTC
svn commit: r1482805 -
/activemq/trunk/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java
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();