jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1380058 - /jmeter/trunk/src/components/org/apache/jmeter/timers/ConstantThroughputTimer.java
Date Sun, 02 Sep 2012 21:16:06 GMT
Author: pmouawad
Date: Sun Sep  2 21:16:06 2012
New Revision: 1380058

URL: http://svn.apache.org/viewvc?rev=1380058&view=rev
Log:
Remove wrong synchronized on method (as it would synch on instance while allThreadsInfo is
static.
no need for sync on previousTime.

Modified:
    jmeter/trunk/src/components/org/apache/jmeter/timers/ConstantThroughputTimer.java

Modified: jmeter/trunk/src/components/org/apache/jmeter/timers/ConstantThroughputTimer.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/timers/ConstantThroughputTimer.java?rev=1380058&r1=1380057&r2=1380058&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/timers/ConstantThroughputTimer.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/timers/ConstantThroughputTimer.java Sun
Sep  2 21:16:06 2012
@@ -132,7 +132,7 @@ public class ConstantThroughputTimer ext
             previousTime = currentTime;
             return 0;
         }
-        previousTime = currentTarget;
+        previousTime = currentTarget;            
         return currentTarget - currentTime;
     }
 
@@ -199,9 +199,12 @@ public class ConstantThroughputTimer ext
         return Math.max(calculatedDelay, 0);
     }
 
-    private synchronized void reset() {
-        allThreadsInfo.lastScheduledTime = 0;
+    private void reset() {
+        synchronized (allThreadsInfo.MUTEX) {
+            allThreadsInfo.lastScheduledTime = 0;            
+        }
         threadGroupsInfoMap.clear();
+        // no need to sync as one per instance
         previousTime = 0;
     }
 



Mime
View raw message