Fix concurrent modification of pagedInMessages

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@634472 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2008-03-07 00:10:20 +00:00
parent 9cc2d3776e
commit f4ca650108
1 changed files with 6 additions and 1 deletions

View File

@ -276,7 +276,12 @@ public class Queue extends BaseDestination implements Task {
sub.remove(context, this);
List<QueueMessageReference> list = new ArrayList<QueueMessageReference>();
for (QueueMessageReference node:pagedInMessages.values()){
List<QueueMessageReference> inFlight = null;
synchronized(pagedInMessages) {
inFlight = new ArrayList<QueueMessageReference>(pagedInMessages.values());
}
for (QueueMessageReference node:inFlight){
if (!node.isDropped() && !node.isAcked()
&& node.getLockOwner() == sub) {
if (node.unlock()) {