wsd/DocumentBroker.cpp | 3 +++ 1 file changed, 3 insertions(+) New commits: commit 46b53d7df12591362c6e76e037b8b136a465bc28 Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk> Date: Wed Jun 21 21:49:08 2017 -0400
wsd: don't busy wait when getNewChild fails fast If Forkit is dead, getNewChild will fail fast. Try not to busy loop in that case and yield the CPU for a nominal duration, which currently is the tenth of the normal getNewChild timeout. Change-Id: I1a94dfedbf2a4f4fc12e4d33d1307f70c307987a Reviewed-on: https://gerrit.libreoffice.org/39248 Reviewed-by: Ashod Nakashian <ashnak...@gmail.com> Tested-by: Ashod Nakashian <ashnak...@gmail.com> (cherry picked from commit 8689d11f5cb27f84ec8c49ad7b87abae4b48bee0) Reviewed-on: https://gerrit.libreoffice.org/39250 Reviewed-by: Jan Holesovsky <ke...@collabora.com> Tested-by: Jan Holesovsky <ke...@collabora.com> diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp index 6eaf0d10..c44d0d65 100644 --- a/wsd/DocumentBroker.cpp +++ b/wsd/DocumentBroker.cpp @@ -194,6 +194,9 @@ void DocumentBroker::pollThread() std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now() - _threadStart).count() > timeoutMs) break; + + // Nominal time between retries, lest we busy-loop. getNewChild could also wait, so don't double that here. + std::this_thread::sleep_for(std::chrono::milliseconds(CHILD_REBALANCE_INTERVAL_MS / 10)); } while (!_stop && _poll->continuePolling() && !TerminationFlag && !ShutdownRequestFlag); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits