wsd/LOOLWSD.cpp |   10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

New commits:
commit bc067c7b299ed1299b7fb4546444abf403cb6c5b
Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk>
Date:   Mon Jun 19 22:47:30 2017 -0400

    wsd: always prespawn children when creating forkit
    
    Also, no need for the DocBrokerMutex to be locked
    in createForkit.
    
    Change-Id: I651c50c8b5518f7b0ee0d8b15c413fc070e30443
    Reviewed-on: https://gerrit.libreoffice.org/38993
    Reviewed-by: Ashod Nakashian <ashnak...@gmail.com>
    Tested-by: Ashod Nakashian <ashnak...@gmail.com>

diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index 6a62d9d9..eecc6d27 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -1163,6 +1163,8 @@ bool LOOLWSD::createForKit()
 #else
     LOG_INF("Creating new forkit process.");
 
+    std::unique_lock<std::mutex> newChildrenLock(NewChildrenMutex);
+
     Process::Args args;
     args.push_back("--losubpath=" + std::string(LO_JAIL_SUBPATH));
     args.push_back("--systemplate=" + SysTemplate);
@@ -1195,10 +1197,6 @@ bool LOOLWSD::createForKit()
         args.push_back("--nocaps");
     }
 
-    // If we're recovering forkit, don't allow processing new requests.
-    std::unique_lock<std::mutex> docBrokersLock(DocBrokersMutex);
-    std::unique_lock<std::mutex> newChildrenLock(NewChildrenMutex);
-
     // Always reap first, in case we haven't done so yet.
     if (ForKitProcId != -1)
     {
@@ -1236,6 +1234,7 @@ bool LOOLWSD::createForKit()
     Admin::instance().setForKitPid(ForKitProcId);
     Admin::instance().setForKitWritePipe(ForKitWritePipe);
 
+    rebalanceChildren(LOOLWSD::NumPreSpawnedChildren - 1);
     return ForKitProcId != -1;
 #endif
 }
@@ -2558,9 +2557,6 @@ int LOOLWSD::innerMain()
     }
 #endif
 
-    // Prefork initial children
-    prespawnChildren();
-
     // Start the server.
     srv.start(ClientPortNumber);
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to