mirror of https://github.com/apache/activemq.git
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
This commit is contained in:
parent
548c19496c
commit
c5788d24bc
|
@ -799,12 +799,13 @@ public class Queue extends BaseDestination implements Task, UsageListener {
|
|||
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();
|
||||
|
|
Loading…
Reference in New Issue