activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r550796 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/memory/UsageManager.java
Date Tue, 26 Jun 2007 13:04:41 GMT
Author: jstrachan
Date: Tue Jun 26 06:04:40 2007
New Revision: 550796

URL: http://svn.apache.org/viewvc?view=rev&rev=550796
Log:
avoid concurrent modification exception on linux

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/memory/UsageManager.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/memory/UsageManager.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/memory/UsageManager.java?view=diff&rev=550796&r1=550795&r2=550796
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/memory/UsageManager.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/memory/UsageManager.java
Tue Jun 26 06:04:40 2007
@@ -20,6 +20,7 @@
 import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
+import java.util.ArrayList;
 import java.util.concurrent.CopyOnWriteArrayList;
 
 import org.apache.activemq.Service;
@@ -326,7 +327,7 @@
         if(oldPercentUsage>=100&&newPercentUsage<100){
             synchronized(usageMutex){
                 usageMutex.notifyAll();
-                for (Iterator iter = callbacks.iterator(); iter.hasNext();) {
+                for (Iterator iter = new ArrayList<Runnable>(callbacks).iterator();
iter.hasNext();) {
 					Runnable callback = (Runnable) iter.next();
 					callback.run();
 				}



Mime
View raw message