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

Jan Holesovsky kendy at collabora.com
Mon Sep 26 08:15:08 UTC 2016


 loolwsd/MessageQueue.cpp |    7 +++++++
 1 file changed, 7 insertions(+)

New commits:
commit 5320b94c601948ac66fe6359045316ec6b45794c
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Mon Sep 26 10:12:45 2016 +0200

    Avoid starving when we are getting way too many priority tiles.
    
    Change-Id: If06d6c2b99ca38894e74154aaffdc25a1c54d2b6

diff --git a/loolwsd/MessageQueue.cpp b/loolwsd/MessageQueue.cpp
index 17b3bf8..830a162 100644
--- a/loolwsd/MessageQueue.cpp
+++ b/loolwsd/MessageQueue.cpp
@@ -185,6 +185,13 @@ MessageQueue::Payload TileQueue::get_impl()
     {
         auto& it = _queue[i];
         const std::string prio(it.data(), it.size());
+
+        // avoid starving - stop the search when we reach a non-tile,
+        // otherwise we may keep growing the queue of unhandled stuff (both
+        // tiles and non-tiles)
+        if (prio.compare(0, 5, "tile ") != 0)
+            break;
+
         if (priority(prio))
         {
             Log::debug() << "Handling a priority message: " << prio << Log::end;


More information about the Libreoffice-commits mailing list