logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mattsic...@apache.org
Subject svn commit: r1584462 - /logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java
Date Thu, 03 Apr 2014 23:20:33 GMT
Author: mattsicker
Date: Thu Apr  3 23:20:32 2014
New Revision: 1584462

URL: http://svn.apache.org/r1584462
Log:
Add note to fix double-checked locking.

Modified:
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java?rev=1584462&r1=1584461&r2=1584462&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java
Thu Apr  3 23:20:32 2014
@@ -112,6 +112,8 @@ public abstract class ConfigurationFacto
      * @return the ConfigurationFactory.
      */
     public static ConfigurationFactory getInstance() {
+        // FIXME: double-checked locking is unsafe
+        // http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html
         if (factories == null) {
             synchronized(TEST_PREFIX) {
                 if (factories == null) {



Mime
View raw message