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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to