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 d3b498cc47
("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 <glogow@fbihome.de>
This commit is contained in:
Jan-Marek Glogowski 2021-03-19 15:21:58 +01:00
parent e7664871ee
commit 1c51a52fda

View file

@ -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() << " "