diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-09-08 16:58:32 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-09-08 17:01:31 +0100 |
commit | 5bac7853a89b9b34d64334d6d77582c7cd79b4ee (patch) | |
tree | 8a5f21179a793a17adb3d8f1e4604955fae1dbc6 /vcl/source | |
parent | 82d25c02f8569aadf166fa92fb581fa68c12fbd1 (diff) |
Ensure the scheduler can set longer timeouts.
Regression from: 6d64d2f38d9f6c2f54e05675ecd0709eabf6d8ca.
Also fix the low priority idle min timeout to 5ms.
Change-Id: I26a6e89ef7fa173e64ee34f7a500157ba82b7198
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/app/idle.cxx | 2 | ||||
-rw-r--r-- | vcl/source/app/scheduler.cxx | 15 |
2 files changed, 12 insertions, 5 deletions
diff --git a/vcl/source/app/idle.cxx b/vcl/source/app/idle.cxx index 6929d62cceac..dcf11b25a957 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 b8849a18234c..c4fb7010ad1d 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--; } |