tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: svn commit: r1051539 - /tomcat/trunk/java/org/apache/tomcat/util/threads/CounterLatch.java
Date Wed, 22 Dec 2010 02:29:10 GMT
On 21 December 2010 16:14,  <fhanik@apache.org> wrote:
> Author: fhanik
> Date: Tue Dec 21 16:14:24 2010
> New Revision: 1051539
>
> URL: http://svn.apache.org/viewvc?rev=1051539&view=rev
> Log:
> make shared variable volatile
>
> Modified:
>    tomcat/trunk/java/org/apache/tomcat/util/threads/CounterLatch.java
>
> Modified: tomcat/trunk/java/org/apache/tomcat/util/threads/CounterLatch.java
> URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/threads/CounterLatch.java?rev=1051539&r1=1051538&r2=1051539&view=diff
> ==============================================================================
> --- tomcat/trunk/java/org/apache/tomcat/util/threads/CounterLatch.java (original)
> +++ tomcat/trunk/java/org/apache/tomcat/util/threads/CounterLatch.java Tue Dec 21 16:14:24
2010
> @@ -49,7 +49,7 @@ public class CounterLatch {
>
>     private final Sync sync;
>     private final AtomicLong count;
> -    private long signal;
> +    private volatile long signal;

It would be cheaper to make it final as it's only ever set in the ctor
and is immutable.

>     private volatile boolean released = false;
>
>     /**
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message