Search code examples
c++log4cxx

Porting old log4cxx code: synchronized missing


I have httpd server and I have used log4cxx for logging. But the log4cxx I was using was very old and I need to upgrade it now. When I tried to do it, I saw so many files have been removed.

For example synchronized.h and synchronized.cpp are removed in v1.1.0 but present in v0.10.0.

In my code I used synchronized like this

synchronized sync(mutex);

But now as synchronized.h and .cpp are removed I can't use the same code.


Solution

  • The synchronized.{cpp,h} files were removed in this commit.

    You should replace all uses of the previous Mutex class with the C++ std::mutex and synchronized with std::lock_guard. But you are free to take your mutex implementation from Boost or other sources as well.