[Libreoffice-commits] online.git: kit/Kit.cpp

Michael Meeks (via logerrit) logerrit at kemper.freedesktop.org
Fri Jul 17 10:30:12 UTC 2020


 kit/Kit.cpp |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

New commits:
commit 0084c3b275bbbad7f3ee2d36f86afc10fbc5400c
Author:     Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Thu Jul 16 19:10:05 2020 +0100
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Fri Jul 17 12:29:54 2020 +0200

    Process any pending tileQueue items first.
    
    Change-Id: I078bc1f52ba7647ca1715ea3222d695936dd657f
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98928
    Tested-by: Jenkins
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/kit/Kit.cpp b/kit/Kit.cpp
index 123a87e66..37016d420 100644
--- a/kit/Kit.cpp
+++ b/kit/Kit.cpp
@@ -1386,11 +1386,16 @@ private:
     }
 
 public:
+    bool hasQueueItems() const
+    {
+        return _tileQueue && !_tileQueue->isEmpty();
+    }
+
     void drainQueue(const std::chrono::steady_clock::time_point &/*now*/)
     {
         try
         {
-            while (!_tileQueue->isEmpty())
+            while (hasQueueItems())
             {
                 if (_stop || SigUtil::getTerminationFlag())
                 {
@@ -1679,7 +1684,10 @@ public:
             _pollEnd = std::chrono::steady_clock::now() + std::chrono::microseconds(timeoutMicroS);
             do
             {
-                if (poll(timeoutMicroS) <= 0)
+                int realTimeout = timeoutMicroS;
+                if (_document && _document->hasQueueItems())
+                    realTimeout = 0;
+                if (poll(realTimeout) <= 0)
                     break;
 
                 const auto now = std::chrono::steady_clock::now();


More information about the Libreoffice-commits mailing list