vcl/source/app/scheduler.cxx |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

New commits:
commit 1c51a52fda039cafaa6b6f9cc817b1e54ac04ee5
Author:     Jan-Marek Glogowski <glo...@fbihome.de>
AuthorDate: Fri Mar 19 15:21:58 2021 +0100
Commit:     Jan-Marek Glogowski <glo...@fbihome.de>
CommitDate: Tue Mar 23 19:58:49 2021 +0100

    VCL force Scheduler instant timeout on task skip
    
    If we skipped the current task processing, we need to immediately
    schedule a new timeout, as we know there is a pending task. So set
    nMinPeriod to 0, as it contains the period to the next pending
    task, and update the system timer.
    
    Fix regression from commit d3b498cc4732f964919fecb265085cefcc422469
    ("invoke idle priority timers only when actually idle").
    
    Change-Id: Ie3fc176fade595ec7406fec0835835bd86dfbd90
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112762
    Tested-by: Jenkins
    Reviewed-by: Jan-Marek Glogowski <glo...@fbihome.de>

diff --git a/vcl/source/app/scheduler.cxx b/vcl/source/app/scheduler.cxx
index 57b8176521f7..6ec07d4b020f 100644
--- a/vcl/source/app/scheduler.cxx
+++ b/vcl/source/app/scheduler.cxx
@@ -425,11 +425,6 @@ bool Scheduler::ProcessTaskScheduling()
             break;
     }
 
-    if ( InfiniteTimeoutMs != nMinPeriod )
-        SAL_INFO("vcl.schedule", "Calculated minimum timeout as " << nMinPeriod
-                                 << " of " << nTasks << " tasks" );
-    UpdateSystemTimer( rSchedCtx, nMinPeriod, true, nTime );
-
     // Delay invoking tasks with idle priorities as long as there are user 
input or repaint events
     // in the OS event queue. This will often effectively compress such events 
and repaint only
     // once at the end, improving performance in cases such as repeated 
zooming with a complex document.
@@ -439,8 +434,14 @@ bool Scheduler::ProcessTaskScheduling()
         SAL_INFO( "vcl.schedule", tools::Time::GetSystemTicks()
             << " idle priority task " << pMostUrgent << " delayed, system 
events pending" );
         pMostUrgent = nullptr;
+        nMinPeriod = 0;
     }
 
+    if (InfiniteTimeoutMs != nMinPeriod)
+        SAL_INFO("vcl.schedule",
+                 "Calculated minimum timeout as " << nMinPeriod << " of " << 
nTasks << " tasks");
+    UpdateSystemTimer(rSchedCtx, nMinPeriod, true, nTime);
+
     if ( pMostUrgent )
     {
         SAL_INFO( "vcl.schedule", tools::Time::GetSystemTicks() << " "
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to