From: markt Date: Thu, 18 Jun 2009 12:58:07 +0000 (+0000) Subject: Add volatiles as suggested by Tim to align code with AccessLogValve. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=75e386b5aad8bc121c3eee000be0435dcc051f5d;p=tomcat7.0 Add volatiles as suggested by Tim to align code with AccessLogValve. No significant change to results (on my machine at least ;) git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@786045 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/test/org/apache/catalina/valves/Benchmarks.java b/test/org/apache/catalina/valves/Benchmarks.java index ca76d62f5..1b4d5d579 100644 --- a/test/org/apache/catalina/valves/Benchmarks.java +++ b/test/org/apache/catalina/valves/Benchmarks.java @@ -36,7 +36,7 @@ public class Benchmarks extends TestCase { } private static class GetDateBenchmarkTest extends BenchmarkTest { - private long currentMillis = 0; + private volatile long currentMillis = 0; private Date currentDate = null; private ThreadLocal currentMillisLocal = new ThreadLocal() { @@ -78,8 +78,8 @@ public class Benchmarks extends TestCase { } private static class TimeDateElementBenchmarkTest extends BenchmarkTest { - private long currentMillis = 0; - private Date currentDate = null; + private volatile long currentMillis = 0; + private volatile Date currentDate = null; private String currentDateString = null; private SimpleDateFormat dayFormatter = new SimpleDateFormat("dd"); private SimpleDateFormat monthFormatter = new SimpleDateFormat("MM");