loolwsd/LOOLWSD.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
New commits: commit 8b18038718f88708dbd08aa61fe60edde3ff7af1 Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk> Date: Tue May 3 08:36:53 2016 -0400 loolwsd: prespawnChildren should be forgiving when lock is not available Change-Id: Id84aa873113f7d3d575ad10504582d93eff51baa Reviewed-on: https://gerrit.libreoffice.org/24637 Reviewed-by: Ashod Nakashian <ashnak...@gmail.com> Tested-by: Ashod Nakashian <ashnak...@gmail.com> diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp index 55329af..d4d8dcc 100644 --- a/loolwsd/LOOLWSD.cpp +++ b/loolwsd/LOOLWSD.cpp @@ -189,7 +189,12 @@ static void preForkChildren() static void prespawnChildren() { - std::unique_lock<std::mutex> lock(newChildrenMutex); + std::unique_lock<std::mutex> lock(newChildrenMutex, std::defer_lock); + if (!lock.try_lock()) + { + // We are forking already? Try later. + return; + } for (int i = newChildren.size() - 1; i >= 0; --i) { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits