You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2009/06/19 14:40:57 UTC
svn commit: r786483 -
/tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java
Author: markt
Date: Fri Jun 19 12:40:56 2009
New Revision: 786483
URL: http://svn.apache.org/viewvc?rev=786483&view=rev
Log:
Add an additional volatile from a review of the associated benchmark tests.
Add a sync
Modified:
tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java
Modified: tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java?rev=786483&r1=786482&r2=786483&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java (original)
+++ tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java Fri Jun 19 12:40:56 2009
@@ -281,7 +281,7 @@
* The system time when we last updated the Date that this valve
* uses for log lines.
*/
- private Date currentDate = null;
+ private volatile Date currentDate = null;
private volatile long currentMillis = 0;
@@ -690,10 +690,12 @@
}
// Log this message
- if (writer != null) {
- writer.println(message);
- if (!buffered) {
- writer.flush();
+ synchronized(this) {
+ if (writer != null) {
+ writer.println(message);
+ if (!buffered) {
+ writer.flush();
+ }
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org