Author: markt
Date: Thu Jun 18 12:58:07 2009
New Revision: 786045
URL: http://svn.apache.org/viewvc?rev=786045&view=rev
Log:
Add volatiles as suggested by Tim to align code with AccessLogValve.
No significant change to results (on my machine at least ;)
Modified:
tomcat/trunk/test/org/apache/catalina/valves/Benchmarks.java
Modified: tomcat/trunk/test/org/apache/catalina/valves/Benchmarks.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/valves/Benchmarks.java?rev=786045&r1=786044&r2=786045&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/valves/Benchmarks.java (original)
+++ tomcat/trunk/test/org/apache/catalina/valves/Benchmarks.java Thu Jun 18
12:58:07 2009
@@ -36,7 +36,7 @@
}
private static class GetDateBenchmarkTest extends BenchmarkTest {
- private long currentMillis = 0;
+ private volatile long currentMillis = 0;
private Date currentDate = null;
private ThreadLocal<Long> currentMillisLocal = new ThreadLocal<Long>()
{
@@ -78,8 +78,8 @@
}
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");
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]