Affects Version/s: 0.10.0
Fix Version/s: None
Environment:Operating System: Windows 2003 R2
Compiler: Visual Studio 2005 SP1
log4cxx 0.10.0 was compiled as a DLL.
Note: the reported issue is independent of the above data.
Calling log4cxx::configureAndWatch() results in Logger::mutex being locked first, and Hierarchy::mutex being locked nested.
Calling log4cxx::getLogger() results in Hierarchy::mutex being locked first, and Logger::mutex being locked nested.
See also the attachment for the full call stacks.
Such behavior is called locking inversion and can result in a sporadic deadlock.
This issue has been found via Intel Thread Checker.
Note: there are also other tools that can detect locking inversion, e.g. the Helgrind tool included with the Valgrind suite.