[logback-dev] svn commit: r2073 - logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic

noreply.ceki at qos.ch noreply.ceki at qos.ch
Fri Dec 5 19:08:42 CET 2008


Author: ceki
Date: Fri Dec  5 19:08:41 2008
New Revision: 2073

Modified:
   logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/LoggerContext.java

Log:

Removed 'synchronized' keyword from the incSize() and size() methods. 
Synchronization was causing a deadlock described in LBCLASSIC-81
These two methods are used internally by logback for testing purposes.

Modified: logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/LoggerContext.java
==============================================================================
--- logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/LoggerContext.java	(original)
+++ logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/LoggerContext.java	Fri Dec  5 19:08:41 2008
@@ -54,8 +54,7 @@
 
   // We want loggerCache to be synchronized so Hashtable is a good choice. In
   // practice, it performs a little faster than the map returned by
-  // Collections.synchronizedMap at the
-  // cost of a very slightly higher memory footprint.
+  // Collections.synchronizedMap at the cost of a very slightly higher memory footprint.
   private Hashtable<String, Logger> loggerCache;
 
   private LoggerContextRemoteView loggerContextRemoteView;
@@ -151,11 +150,11 @@
     }
   }
 
-  private synchronized void incSize() {
+  private void incSize() {
     size++;
   }
 
-  synchronized int size() {
+  int size() {
     return size;
   }
 


More information about the logback-dev mailing list