include/vcl/scheduler.hxx | 2 +- vcl/source/app/idle.cxx | 2 +- vcl/source/app/scheduler.cxx | 15 +++++++++++---- 3 files changed, 13 insertions(+), 6 deletions(-)
New commits: commit 5bac7853a89b9b34d64334d6d77582c7cd79b4ee Author: Michael Meeks <michael.me...@collabora.com> Date: Tue Sep 8 16:58:32 2015 +0100 Ensure the scheduler can set longer timeouts. Regression from: 6d64d2f38d9f6c2f54e05675ecd0709eabf6d8ca. Also fix the low priority idle min timeout to 5ms. Change-Id: I26a6e89ef7fa173e64ee34f7a500157ba82b7198 diff --git a/include/vcl/scheduler.hxx b/include/vcl/scheduler.hxx index 612bd08..a197cbc 100644 --- a/include/vcl/scheduler.hxx +++ b/include/vcl/scheduler.hxx @@ -64,7 +64,7 @@ protected: static const sal_uInt64 ImmediateTimeoutMs = 1; static const sal_uInt64 MaximumTimeoutMs = SAL_MAX_UINT64; - static void ImplStartTimer(sal_uInt64 nMS); + static void ImplStartTimer(sal_uInt64 nMS, bool bForce = false); friend struct ImplSchedulerData; virtual void SetDeletionFlags(); diff --git a/vcl/source/app/idle.cxx b/vcl/source/app/idle.cxx index 6929d62..dcf11b2 100644 --- a/vcl/source/app/idle.cxx +++ b/vcl/source/app/idle.cxx @@ -65,7 +65,7 @@ sal_uInt64 Idle::UpdateMinPeriod( sal_uInt64 nMinPeriod, sal_uInt64 /* nTime */ break; default: // FIXME: tdf#92036 workaround, I should be 1 too - wait 5ms - if (nMinPeriod > 5) + if (nMinPeriod < 5) nMinPeriod = 5; break; } diff --git a/vcl/source/app/scheduler.cxx b/vcl/source/app/scheduler.cxx index b8849a1..c4fb701 100644 --- a/vcl/source/app/scheduler.cxx +++ b/vcl/source/app/scheduler.cxx @@ -104,15 +104,22 @@ void Scheduler::ImplDeInitScheduler() pSVData->mpSalTimer = 0; } -void Scheduler::ImplStartTimer(sal_uInt64 nMS) +/** + * Start a new timer if we need to for @nMS duration. + * + * if this is longer than the existing duration we're + * waiting for, do nothing - unless @bForce - which means + * to reset the minimum period; used by the scheduled itself. + */ +void Scheduler::ImplStartTimer(sal_uInt64 nMS, bool bForce) { ImplSVData* pSVData = ImplGetSVData(); InitSystemTimer(pSVData); // Update timeout only when not in timer handler and // only if smaller timeout, to avoid skipping. - if (!pSVData->mnUpdateStack && - nMS < pSVData->mnTimerPeriod) + if (bForce || (!pSVData->mnUpdateStack && + nMS < pSVData->mnTimerPeriod)) { pSVData->mnTimerPeriod = nMS; pSVData->mpSalTimer->Start(nMS); @@ -198,7 +205,7 @@ void Scheduler::ProcessTaskScheduling( bool bTimer ) } else { - Scheduler::ImplStartTimer(nMinPeriod); + Scheduler::ImplStartTimer(nMinPeriod, true); } pSVData->mnUpdateStack--; } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits