activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r633808 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Topic.java
Date Wed, 05 Mar 2008 10:17:43 GMT
Author: rajdavies
Date: Wed Mar  5 02:17:43 2008
New Revision: 633808

URL: http://svn.apache.org/viewvc?rev=633808&view=rev
Log:
synchronize around the messagesWaitingForSpace

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

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Topic.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Topic.java?rev=633808&r1=633807&r2=633808&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Topic.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Topic.java
Wed Mar  5 02:17:43 2008
@@ -505,9 +505,11 @@
     }
     
     public boolean iterate() {
-        while (!memoryUsage.isFull() && !messagesWaitingForSpace.isEmpty()) {
-            Runnable op = messagesWaitingForSpace.removeFirst();
-            op.run();
+        synchronized(messagesWaitingForSpace) {
+            while (!memoryUsage.isFull() && !messagesWaitingForSpace.isEmpty()) {
+                Runnable op = messagesWaitingForSpace.removeFirst();
+                op.run();
+            }
         }
         return false;
     }



Mime
View raw message