From c5788d24bcfc9d568fb7828d7eabb4f2eee1830b Mon Sep 17 00:00:00 2001 From: "Hiram R. Chirino" Date: Wed, 15 May 2013 13:11:07 +0000 Subject: [PATCH] Reduce the amount of work done while the sendLock is acquired. git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1482805 13f79535-47bb-0310-9956-ffa450edef68 --- .../main/java/org/apache/activemq/broker/region/Queue.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java b/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java index 75f1504bbb..2864efa6dd 100755 --- a/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java +++ b/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java @@ -799,12 +799,13 @@ public class Queue extends BaseDestination implements Task, UsageListener { if (!orderedWork.isEmpty()) { ArrayList syncs = new ArrayList(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();