tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yo...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/log SystemLogHandler.java
Date Thu, 02 Sep 2004 18:51:00 GMT
yoavs       2004/09/02 11:51:00

  Modified:    webapps/docs Tag: TOMCAT_5_0 changelog.xml
               util/java/org/apache/tomcat/util/log Tag: TOMCAT_5_0
                        SystemLogHandler.java
  Log:
  Addressed Bugzilla 31018.
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.70.2.28 +7 -0      jakarta-tomcat-catalina/webapps/docs/changelog.xml
  
  Index: changelog.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/docs/changelog.xml,v
  retrieving revision 1.70.2.27
  retrieving revision 1.70.2.28
  diff -u -r1.70.2.27 -r1.70.2.28
  --- changelog.xml	2 Sep 2004 18:45:38 -0000	1.70.2.27
  +++ changelog.xml	2 Sep 2004 18:51:00 -0000	1.70.2.28
  @@ -76,6 +76,13 @@
         </fix>
       </changelog>
     </subsection>
  +  <subsection name="Coyote">
  +    <changelog>
  +      <fix>
  +        <bug>31018</bug>: Race condition in SystemLogHandler. (yoavs)
  +      </fix>
  +    </changelog>
  +  </subsection>
   </section>
   
   <section name="Tomcat 5.0.28 (yoavs)">
  
  
  
  No                   revision
  No                   revision
  1.4.2.1   +6 -4      jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/log/SystemLogHandler.java
  
  Index: SystemLogHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/log/SystemLogHandler.java,v
  retrieving revision 1.4
  retrieving revision 1.4.2.1
  diff -u -r1.4 -r1.4.2.1
  --- SystemLogHandler.java	24 Feb 2004 08:50:06 -0000	1.4
  +++ SystemLogHandler.java	2 Sep 2004 18:51:00 -0000	1.4.2.1
  @@ -75,17 +75,19 @@
        */
       public static void startCapture() {
           CaptureLog log = null;
  -        if (!reuse.isEmpty()) {
  -            log = (CaptureLog)reuse.pop();
  -        } else {
  -            log = new CaptureLog();
  +
  +        // Synchronized for Bugzilla 31018
  +        synchronized(reuse) {
  +            log = reuse.isEmpty() ? new CaptureLog() : (CaptureLog)reuse.pop();
           }
  +
           Thread thread = Thread.currentThread();
           Stack stack = (Stack)logs.get(thread);
           if (stack == null) {
               stack = new Stack();
               logs.put(thread, stack);
           }
  +
           stack.push(log);
       }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message