jmeter-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: svn commit: r1437169 - /jmeter/trunk/src/components/org/apache/jmeter/control/ThroughputController.java
Date Tue, 22 Jan 2013 22:05:58 GMT
On 22 January 2013 21:04,  <pmouawad@apache.org> wrote:
> Author: pmouawad
> Date: Tue Jan 22 21:04:44 2013
> New Revision: 1437169
>
> URL: http://svn.apache.org/viewvc?rev=1437169&view=rev
> Log:
> Don't synch on String
> http://www.javalobby.org/java/forums/t96352.html
>
> Modified:
>     jmeter/trunk/src/components/org/apache/jmeter/control/ThroughputController.java
>
> Modified: jmeter/trunk/src/components/org/apache/jmeter/control/ThroughputController.java
> URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/control/ThroughputController.java?rev=1437169&r1=1437168&r2=1437169&view=diff
> ==============================================================================
> --- jmeter/trunk/src/components/org/apache/jmeter/control/ThroughputController.java (original)
> +++ jmeter/trunk/src/components/org/apache/jmeter/control/ThroughputController.java Tue
Jan 22 21:04:44 2013
> @@ -78,7 +78,7 @@ public class ThroughputController extend
>
>      private transient MutableInteger globalIteration;
>
> -    private String counterLock = ""; // ensure counts are updated correctly
> +    private Byte counterLock = new Byte("0"); // ensure counts are updated correctly
>      // Need to use something that is serializable, so Object is no use

Are we sure that the lock needs to be serialised?
That seems rather unlikely.
After all the lock is used to protect the transient globalIteration field.

Might work OK just to use a transient Object.

In fact some other fields could probably be made transient as well.

>      /**
>
>

Mime
View raw message