activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r634472 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java
Date Fri, 07 Mar 2008 00:10:37 GMT
Author: rajdavies
Date: Thu Mar  6 16:10:20 2008
New Revision: 634472

URL: http://svn.apache.org/viewvc?rev=634472&view=rev
Log:
Fix concurrent modification of pagedInMessages

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java?rev=634472&r1=634471&r2=634472&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java
Thu Mar  6 16:10:20 2008
@@ -276,7 +276,12 @@
                 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()) {



Mime
View raw message