wsd/LOOLWSD.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
New commits: commit 731bfb08c5a2937f0833f7e657e616ff1470c8c3 Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk> Date: Thu Jan 5 10:26:04 2017 -0500 wsd: don't wait on the DocBrokers lock when prespawning children Prespawning proactively is optimistic, but is not critical. When getting a space child, more will be spawn perforce, so prespawnChildren shouldn't block. Change-Id: I60cc8c1ab87cba384ebc9aca9e79b89f69a99252 Reviewed-on: https://gerrit.libreoffice.org/32858 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 b9467bd..0c60114 100644 --- a/wsd/LOOLWSD.cpp +++ b/wsd/LOOLWSD.cpp @@ -411,7 +411,13 @@ static void preForkChildren() static bool prespawnChildren(const bool force) { // First remove dead DocBrokers, if possible. - std::unique_lock<std::mutex> docBrokersLock(DocBrokersMutex); + std::unique_lock<std::mutex> docBrokersLock(DocBrokersMutex, std::defer_lock); + if (!docBrokersLock.try_lock()) + { + // Busy, try again later. + return false; + } + cleanupDocBrokers(); std::unique_lock<std::mutex> lock(NewChildrenMutex, std::defer_lock); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits