activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r633210 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java
Date Mon, 03 Mar 2008 18:03:22 GMT
Author: chirino
Date: Mon Mar  3 10:03:21 2008
New Revision: 633210

URL: http://svn.apache.org/viewvc?rev=633210&view=rev
Log:
Protect the messagesWaitingForSpace variable against concurrent modification.

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=633210&r1=633209&r2=633210&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
Mon Mar  3 10:03:21 2008
@@ -885,9 +885,12 @@
                 log.error("Failed to page in more queue messages ", e);
             }
         }
-        while (!messagesWaitingForSpace.isEmpty() && !memoryUsage.isFull()) {
-            Runnable op = messagesWaitingForSpace.removeFirst();
-            op.run();
+        
+        synchronized(messagesWaitingForSpace) {
+               while (!messagesWaitingForSpace.isEmpty() && !memoryUsage.isFull())
{
+                   Runnable op = messagesWaitingForSpace.removeFirst();
+                   op.run();
+               }
         }
         return false;
     }



Mime
View raw message