Loading...

log4cxx-dev@logging.apache.org

[Prev] Thread [Next]  |  [Prev] Date [Next]

svn commit: r954356 - in /logging/log4cxx/trunk/src: changes/changes.xml main/cpp/logger.cpp carnold Sun Jun 13 22:00:13 2010

Author: carnold
Date: Mon Jun 14 04:24:05 2010
New Revision: 954356

URL: http://svn.apache.org/viewvc?rev=954356&view=rev
Log:
LOGCXX-317: Log4cxx triggers locking inversion which can result in a deadlock

Modified:
    logging/log4cxx/trunk/src/changes/changes.xml
    logging/log4cxx/trunk/src/main/cpp/logger.cpp

Modified: logging/log4cxx/trunk/src/changes/changes.xml
URL: 
http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/changes/changes.xml?rev=954356&r1=954355&r2=954356&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/changes/changes.xml (original)
+++ logging/log4cxx/trunk/src/changes/changes.xml Mon Jun 14 04:24:05 2010
@@ -23,7 +23,6 @@
 </properties>
 <body>
 <release version="0.11.0" date="2010-XX-XX" description="Maintenance release">
-<action issue="LOGCXX-365">Unit tests fail on system dates later than 
2009-12-31.</action>
 <action issue="LOGCXX-249">Console appender crashes if layout is not 
set</action>
 <action issue="LOGCXX-262">socketappendertestcase and 
xmlsocketappendertestcase not run</action>
 <action issue="LOGCXX-263">Bad link to log4cxx-dev archive</action>
@@ -55,6 +54,8 @@
 <action issue="LOGCXX-304">BasicConfigurator::configure results in writer not 
set warning.</action>
 <action issue="LOGCXX-340">Transcoder::encodeCharsetName bungles 
encoding</action>
 <action issue="LOGCXX-351">Download page does not have link to KEYS 
file</action>
+<action issue="LOGCXX-365">Unit tests fail on system dates later than 
2009-12-31.</action>
+<action issue="LOGCXX-317">Log4cxx triggers locking inversion which can result 
in a deadlock.</action>
 </release>
 <release version="0.10.0" date="2008-04-03" description="First Apache release">
 <action issue="LOGCXX-2">logger.h includes config.h</action>

Modified: logging/log4cxx/trunk/src/main/cpp/logger.cpp
URL: 
http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/main/cpp/logger.cpp?rev=954356&r1=954355&r2=954356&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/main/cpp/logger.cpp (original)
+++ logging/log4cxx/trunk/src/main/cpp/logger.cpp Mon Jun 14 04:24:05 2010
@@ -64,6 +64,8 @@ void Logger::releaseRef() const {
 
 void Logger::addAppender(const AppenderPtr& newAppender)
 {
+   log4cxx::spi::LoggerRepository* rep = 0;
+   {
         synchronized sync(mutex);
 
         if (aai == 0)
@@ -71,8 +73,10 @@ void Logger::addAppender(const AppenderP
                   aai = new AppenderAttachableImpl(*pool);
         }
         aai->addAppender(newAppender);
-   if (repository != 0) {
-           repository->fireAddAppenderEvent(this, newAppender);
+        rep = repository;
+   }
+   if (rep != 0) {
+           rep->fireAddAppenderEvent(this, newAppender);
    }
 }