[Libreoffice-commits] online.git: loolwsd/LOOLWSD.cpp

Ashod Nakashian ashod.nakashian at collabora.co.uk
Tue Nov 8 00:21:37 UTC 2016


 loolwsd/LOOLWSD.cpp |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit d8c2bb919526688f20be6d9f9eae96edb2cb3f59
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Mon Nov 7 18:21:28 2016 -0500

    loolwsd: minimize holding locks beyond the necessary point
    
    Change-Id: I379a649469622682d7ebe98b8a7ebe29eddd1dfa
    Reviewed-on: https://gerrit.libreoffice.org/30674
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index 425b20f..6334a2c 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -347,11 +347,13 @@ static void prespawnChildren()
 static size_t addNewChild(const std::shared_ptr<ChildProcess>& child)
 {
     std::unique_lock<std::mutex> lock(NewChildrenMutex);
+
     --OutstandingForks;
     NewChildren.emplace_back(child);
     const auto count = NewChildren.size();
-    LOG_INF("Have " << count << " " << (count == 1 ? "child." : "children."));
+    lock.unlock();
 
+    LOG_INF("Have " << count << " " << (count == 1 ? "child." : "children."));
     NewChildrenCV.notify_one();
     return count;
 }


More information about the Libreoffice-commits mailing list