Fixing regression in last commit.

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1482794 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2013-05-15 12:44:13 +00:00
parent e06685fe81
commit 0deda2501d
1 changed files with 10 additions and 1 deletions

View File

@ -797,15 +797,24 @@ public class Queue extends BaseDestination implements Task, UsageListener {
}
// do the ordered work
if (!orderedWork.isEmpty()) {
ArrayList<SendSync> syncs = new ArrayList<SendSync>(orderedWork.size());;
sendLock.lockInterruptibly();
try {
for (Transaction tx : orderedWork) {
sendSyncs.get(tx).processSend();
SendSync sync = sendSyncs.get(tx);
sync.processSend();
syncs.add(sync);
sendSyncs.remove(tx);
}
} finally {
sendLock.unlock();
}
for (SendSync sync : syncs) {
sync.processSent();
}
}
}