loolwsd/LOOLWSD.cpp | 10 +++++----- loolwsd/LOOLWSD.hpp | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-)
New commits: commit 66756a77a91d161961407fc09fe30d610823c810 Author: Henry Castro <[email protected]> Date: Sat Jul 18 12:35:16 2015 -0400 loolwsd: change named mutex to private static. diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp index 9af4aad..e38a971 100644 --- a/loolwsd/LOOLWSD.cpp +++ b/loolwsd/LOOLWSD.cpp @@ -420,7 +420,7 @@ std::string LOOLWSD::loSubPath = "lo"; std::string LOOLWSD::jail; std::mutex LOOLWSD::_rngMutex; Random LOOLWSD::_rng; -static NamedMutex namedMutexLOOL("loolwsd"); +Poco::NamedMutex LOOLWSD::_namedMutexLOOL("loolwsd"); Poco::SharedMemory LOOLWSD::_sharedForkChild("loolwsd", sizeof(bool), Poco::SharedMemory::AM_WRITE); int LOOLWSD::_numPreSpawnedChildren = 10; @@ -726,7 +726,7 @@ void LOOLWSD::componentMain() { try { - namedMutexLOOL.lock(); + _namedMutexLOOL.lock(); #ifdef __APPLE__ LibreOfficeKit *loKit(lok_init_2(("/" + loSubPath + "/Frameworks").c_str(), "file:///user")); @@ -740,7 +740,7 @@ void LOOLWSD::componentMain() exit(Application::EXIT_UNAVAILABLE); } - namedMutexLOOL.unlock(); + _namedMutexLOOL.unlock(); // Open websocket connection between the child process and the // parent. The parent forwards us requests that it can't handle. @@ -1028,7 +1028,7 @@ int LOOLWSD::main(const std::vector<std::string>& args) _childId = (((Poco::UInt64)_rng.next()) << 32) | _rng.next() | 1; rngLock.unlock(); - namedMutexLOOL.lock(); + _namedMutexLOOL.lock(); startupDesktop(1); @@ -1053,7 +1053,7 @@ int LOOLWSD::main(const std::vector<std::string>& args) srv2.start(); - namedMutexLOOL.unlock(); + _namedMutexLOOL.unlock(); while (MasterProcessSession::_childProcesses.size() > 0) { diff --git a/loolwsd/LOOLWSD.hpp b/loolwsd/LOOLWSD.hpp index befed88..86896a8 100644 --- a/loolwsd/LOOLWSD.hpp +++ b/loolwsd/LOOLWSD.hpp @@ -20,6 +20,7 @@ #include <Poco/Path.h> #include <Poco/Util/ServerApplication.h> #include <Poco/SharedMemory.h> +#include <Poco/NamedMutex.h> class LOOLWSD: public Poco::Util::ServerApplication { @@ -65,6 +66,7 @@ private: static int _numPreSpawnedChildren; static std::mutex _rngMutex; static Poco::Random _rng; + static Poco::NamedMutex _namedMutexLOOL; #if ENABLE_DEBUG public: _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
