activemq-commits mailing list archives

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

URL: http://svn.apache.org/viewvc?view=rev&rev=550797
Log:
added better synchronization

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=550797&r1=550796&r2=550797
==============================================================================
--- 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:06:32 2007
@@ -307,10 +307,12 @@
     }
     
     private void setPercentUsage(int value) {
-        int oldValue = percentUsage;
-        percentUsage = value;
-        if( oldValue!=value ) {
-            fireEvent(oldValue, value);
+        synchronized (usageMutex) {
+            int oldValue = percentUsage;
+            percentUsage = value;
+            if( oldValue!=value ) {
+                fireEvent(oldValue, value);
+            }
         }
     }
     



Mime
View raw message