ceki        2004/12/28 05:22:08

  Modified:    src/java/org/apache/log4j/spi LoggingEvent.java
  Log:
  access to sequenceCount is now synhcronized using the LoggingClass as the 
monitor (lock).
  
  Revision  Changes    Path
  1.71      +8 -3      
logging-log4j/src/java/org/apache/log4j/spi/LoggingEvent.java
  
  Index: LoggingEvent.java
  ===================================================================
  RCS file: 
/home/cvs/logging-log4j/src/java/org/apache/log4j/spi/LoggingEvent.java,v
  retrieving revision 1.70
  retrieving revision 1.71
  diff -u -r1.70 -r1.71
  --- LoggingEvent.java 28 Nov 2004 17:37:35 -0000      1.70
  +++ LoggingEvent.java 28 Dec 2004 13:22:08 -0000      1.71
  @@ -80,7 +80,7 @@
      *
      * @since 1.3
      */
  -  static long sequenceCount = 1;
  +   static long sequenceCount = 1;
   
     /**
      * Fully qualified name of the calling category class. This field does not
  @@ -244,7 +244,10 @@
       }
   
       timeStamp = System.currentTimeMillis();
  -    sequenceNumber = sequenceCount++;
  +    
  +    synchronized(LoggingEvent.class) {
  +      sequenceNumber = sequenceCount++;
  +    }
     }
   
   
  @@ -278,7 +281,9 @@
       }
   
       this.timeStamp = timeStamp;
  -    sequenceNumber = sequenceCount++;
  +    synchronized(LoggingEvent.class) {
  +      sequenceNumber = sequenceCount++;
  +    }
     }
   
     /**
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to