On 21 December 2010 16:14, <fha...@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-unsubscr...@tomcat.apache.org > For additional commands, e-mail: dev-h...@tomcat.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org