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

Ashod Nakashian ashod.nakashian at collabora.co.uk
Mon Feb 13 05:21:06 UTC 2017


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

New commits:
commit 79c1791764224c8c09c7a9fd4bec306605108701
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Sat Feb 11 11:36:38 2017 -0500

    wsd: don't block on autosave
    
    Change-Id: Id87465f0aeea9d4f29caea9c88d3a8c7837d8ec2
    Reviewed-on: https://gerrit.libreoffice.org/34191
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index 97a6088..d268d68 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -2518,8 +2518,11 @@ int LOOLWSD::main(const std::vector<std::string>& /*args*/)
                     cleanupDocBrokers();
                     for (auto& pair : DocBrokers)
                     {
-                        auto docLock = pair.second->getLock();
-                        pair.second->autoSave(false, 0, docLock);
+                        auto docLock = pair.second->getDeferredLock();
+                        if (docLock.try_lock())
+                        {
+                            pair.second->autoSave(false, 0, docLock);
+                        }
                     }
                 }
                 catch (const std::exception& exc)


More information about the Libreoffice-commits mailing list