[Libreoffice-commits] core.git: Branch 'feature/fixes22' - include/vcl vcl/source
Jan Holesovsky
kendy at collabora.com
Fri May 27 12:29:14 UTC 2016
include/vcl/scheduler.hxx | 1 +
vcl/source/app/idle.cxx | 10 ++++++++++
vcl/source/app/timer.cxx | 6 ++++++
3 files changed, 17 insertions(+)
New commits:
commit 3baeec16f686fcd22677445e65aa5f5b7a1f45c9
Author: Jan Holesovsky <kendy at collabora.com>
Date: Fri May 27 14:13:53 2016 +0200
Implement deterministic scheduler.
Change-Id: I4341e5fafa69d3a759f2331405c5148df2b974fd
diff --git a/include/vcl/scheduler.hxx b/include/vcl/scheduler.hxx
index 95303ee..6010763 100644
--- a/include/vcl/scheduler.hxx
+++ b/include/vcl/scheduler.hxx
@@ -53,6 +53,7 @@ protected:
// These should be constexpr static, when supported.
static const sal_uInt64 ImmediateTimeoutMs = 1;
static const sal_uInt64 MaximumTimeoutMs = 1000 * 60; // 1 minute
+ static const sal_uInt64 InfiniteTimeoutMs = 1000 * 60 * 60 * 24; // 1 day
static void ImplStartTimer(sal_uInt64 nMS, bool bForce = false);
diff --git a/vcl/source/app/idle.cxx b/vcl/source/app/idle.cxx
index 123f37a..62dfe1b 100644
--- a/vcl/source/app/idle.cxx
+++ b/vcl/source/app/idle.cxx
@@ -67,6 +67,16 @@ sal_uInt64 Idle::UpdateMinPeriod( sal_uInt64 nMinPeriod, sal_uInt64 /* nTime */
case SchedulerPriority::REPAINT:
nMinPeriod = ImmediateTimeoutMs; // don't wait.
break;
+ case SchedulerPriority::LOW:
+ case SchedulerPriority::LOWER:
+ case SchedulerPriority::LOWEST:
+ // static bool bDeterministic = getenv("SAL_DETERMINISTIC_SCHEDULING");
+ // if (bDeterministic)
+ // {
+ nMinPeriod = Scheduler::InfiniteTimeoutMs;
+ break;
+ // }
+ // fall-through intended
default:
// FIXME: tdf#92036 workaround, I should be 1 too - wait 5ms
if (nMinPeriod > 5) // only shrink the min. period if nothing is quicker.
diff --git a/vcl/source/app/timer.cxx b/vcl/source/app/timer.cxx
index 1766d7f..d5ace35 100644
--- a/vcl/source/app/timer.cxx
+++ b/vcl/source/app/timer.cxx
@@ -43,6 +43,12 @@ bool Timer::IsIdle() const
sal_uInt64 Timer::UpdateMinPeriod( sal_uInt64 nMinPeriod, sal_uInt64 nTime ) const
{
+ // static bool bDeterministic = getenv("SAL_DETERMINISTIC_SCHEDULING");
+ // if (bDeterministic)
+ // {
+ return Scheduler::InfiniteTimeoutMs;
+ // }
+
sal_uInt64 nDeltaTime;
//determine smallest time slot
if( mpSchedulerData->mnUpdateTime == nTime )
More information about the Libreoffice-commits
mailing list