Expand sync within rotatable block to fix a couple of issues:
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 18 Jun 2009 09:25:00 +0000 (09:25 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 18 Jun 2009 09:25:00 +0000 (09:25 +0000)
commit757607e16cbc022e3f5a2f351d20e91016abf75a
tree9a5ac40d0055aa5d055b156b37445515f2f7a5df
parent0663613b8ee1a22a1c94a5832c46a3dbbc083b12
Expand sync within rotatable block to fix a couple of issues:
 - fileDateFormatter is a SimpleDateFormat which is not thread safe
 - the rotationLastChecked needs to be volatile to ensure we don't execute the sync'd block multiple times
Although this is a sync on 'this' in log which gets called for every request:
 - a similar sync occurs in getDate() for every request with minimal performance impact
 - microbenchmarks suggest that a sync on 'this' has similar performance to using ThreadLocals

 Based on kkolinko's patch for Tomcat 5.5.x

 Note there remains an issue with writing to the log if the log files happens to be in the process of rotating

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@785983 13f79535-47bb-0310-9956-ffa450edef68
java/org/apache/catalina/valves/AccessLogValve.java