[Libreoffice-commits] online.git: Branch 'private/hcvcastro/forking' - loolwsd/LOOLBroker.cpp loolwsd/LOOLWSD.cpp loolwsd/LOOLWSD.hpp loolwsd/MasterProcessSession.cpp
Henry Castro
hcastro at collabora.com
Sun Sep 27 09:08:28 PDT 2015
loolwsd/LOOLBroker.cpp | 12 ------------
loolwsd/LOOLWSD.cpp | 1 -
loolwsd/LOOLWSD.hpp | 2 --
loolwsd/MasterProcessSession.cpp | 8 --------
4 files changed, 23 deletions(-)
New commits:
commit c69e9e3055aed04d0862d3ff968778aa21636937
Author: Henry Castro <hcastro at collabora.com>
Date: Sun Sep 27 12:07:17 2015 -0400
loolwsd: remove shared memory
diff --git a/loolwsd/LOOLBroker.cpp b/loolwsd/LOOLBroker.cpp
index 8930883..57a5cef 100644
--- a/loolwsd/LOOLBroker.cpp
+++ b/loolwsd/LOOLBroker.cpp
@@ -29,7 +29,6 @@
#include <Poco/ThreadLocal.h>
#include <Poco/Process.h>
#include <Poco/Thread.h>
-#include <Poco/SharedMemory.h>
#include <Poco/NamedMutex.h>
#include "Util.hpp"
@@ -305,7 +304,6 @@ int main(int argc, char** argv)
std::string sysTemplate;
std::string loTemplate;
int _numPreSpawnedChildren = 0;
- Poco::SharedMemory _sharedForkChild("loolwsd", sizeof(bool), Poco::SharedMemory::AM_WRITE);
for (int i = 0; i < argc; ++i)
{
@@ -477,16 +475,6 @@ int main(int argc, char** argv)
else if (pid < 0)
std::cout << Util::logPrefix() << "Child error: " << strerror(errno) << std::endl;
- if ( _sharedForkChild.begin()[0] > 0 )
- {
- _namedMutexLOOL.lock();
- _sharedForkChild.begin()[0] = _sharedForkChild.begin()[0] - 1;
- _namedMutexLOOL.unlock();
- std::cout << Util::logPrefix() << "Create child session, fork new one" << std::endl;
- if (createLibreOfficeKit(sharePages, loSubPath, _childId) < 0 )
- break;
- }
-
++timeoutCounter;
if (timeoutCounter == INTERVAL_PROBES)
{
diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index 9d94768..0684285 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -433,7 +433,6 @@ std::string LOOLWSD::jail;
std::mutex LOOLWSD::_rngMutex;
Random LOOLWSD::_rng;
Poco::NamedMutex LOOLWSD::_namedMutexLOOL("loolwsd");
-Poco::SharedMemory LOOLWSD::_sharedForkChild("loolwsd", sizeof(bool), Poco::SharedMemory::AM_WRITE);
int LOOLWSD::_numPreSpawnedChildren = 10;
bool LOOLWSD::doTest = false;
diff --git a/loolwsd/LOOLWSD.hpp b/loolwsd/LOOLWSD.hpp
index 044ea05..4470968 100644
--- a/loolwsd/LOOLWSD.hpp
+++ b/loolwsd/LOOLWSD.hpp
@@ -19,7 +19,6 @@
#include <Poco/Random.h>
#include <Poco/Path.h>
#include <Poco/Util/ServerApplication.h>
-#include <Poco/SharedMemory.h>
#include <Poco/NamedMutex.h>
class LOOLWSD: public Poco::Util::ServerApplication
@@ -39,7 +38,6 @@ public:
static std::string childRoot;
static std::string loSubPath;
static std::string jail;
- static Poco::SharedMemory _sharedForkChild;
static const int DEFAULT_CLIENT_PORT_NUMBER = 9980;
static const int MASTER_PORT_NUMBER = 9981;
diff --git a/loolwsd/MasterProcessSession.cpp b/loolwsd/MasterProcessSession.cpp
index 5670858..c0c5275 100644
--- a/loolwsd/MasterProcessSession.cpp
+++ b/loolwsd/MasterProcessSession.cpp
@@ -408,14 +408,6 @@ void MasterProcessSession::dispatchChild()
_availableChildSessions.erase(childSession);
lock.unlock();
- if (_availableChildSessions.size() == 0 && !LOOLWSD::doTest)
- {
- LOOLWSD::_namedMutexLOOL.lock();
- std::cout << Util::logPrefix() << "No available child sessions, queue new child session" << std::endl;
- LOOLWSD::_sharedForkChild.begin()[0] = (LOOLWSD::_sharedForkChild.begin()[0] > 0 ? LOOLWSD::_sharedForkChild.begin()[0] + 1 : 1);
- LOOLWSD::_namedMutexLOOL.unlock();
- }
-
// Assume a valid URI
URI aUri(_docURL);
More information about the Libreoffice-commits
mailing list