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:48:47 GMT
yoavs       2004/09/02 11:48:47

  Modified:    util/java/org/apache/tomcat/util/log SystemLogHandler.java
  Log:
  Addressed Bugzilla 31018.
  
  Revision  Changes    Path
  1.5       +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.5
  diff -u -r1.4 -r1.5
  --- SystemLogHandler.java	24 Feb 2004 08:50:06 -0000	1.4
  +++ SystemLogHandler.java	2 Sep 2004 18:48:47 -0000	1.5
  @@ -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