mirror of https://github.com/apache/activemq.git
reduce the number of times the sendSyncs map is accessed.
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1482800 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0deda2501d
commit
548c19496c
|
@ -800,18 +800,15 @@ public class Queue extends BaseDestination implements Task, UsageListener {
|
||||||
|
|
||||||
ArrayList<SendSync> syncs = new ArrayList<SendSync>(orderedWork.size());;
|
ArrayList<SendSync> syncs = new ArrayList<SendSync>(orderedWork.size());;
|
||||||
sendLock.lockInterruptibly();
|
sendLock.lockInterruptibly();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
for (Transaction tx : orderedWork) {
|
for (Transaction tx : orderedWork) {
|
||||||
SendSync sync = sendSyncs.get(tx);
|
SendSync sync = sendSyncs.remove(tx);
|
||||||
sync.processSend();
|
sync.processSend();
|
||||||
syncs.add(sync);
|
syncs.add(sync);
|
||||||
sendSyncs.remove(tx);
|
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
sendLock.unlock();
|
sendLock.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (SendSync sync : syncs) {
|
for (SendSync sync : syncs) {
|
||||||
sync.processSent();
|
sync.processSent();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue