summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2016-05-30 17:36:37 +0200
committerJan Holesovsky <kendy@collabora.com>2016-05-31 15:26:59 +0200
commit5acdf13b21e52e3c26657d063a9b327006bc5494 (patch)
treeed552a9ba856082e85944f45477cca370bc3ae5d /include
parent407c675229e803ce1038384c233e3dc028d786e0 (diff)
tdf#100092: Deterministic scheduling to prevent unpredictable behavior.
Low priority idles can fire more or less randomly, and consequently two consequent runs of LibreOffice differ in the amount of the idles that have been performed during an operation. This commit adds a possibility to turn on a 'deterministic mode' where two subsequent runs of LibreOffice trigger about the same amount of events when they perform the same set of operations. Change-Id: I92566ef4eee20e7d604cfd48f01c4df30c77e653
Diffstat (limited to 'include')
-rw-r--r--include/vcl/scheduler.hxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/vcl/scheduler.hxx b/include/vcl/scheduler.hxx
index 760c228b174e..3abd37d6976e 100644
--- a/include/vcl/scheduler.hxx
+++ b/include/vcl/scheduler.hxx
@@ -47,6 +47,7 @@ protected:
// These should be constexpr static, when supported.
static const sal_uInt64 ImmediateTimeoutMs = 1;
+ static const sal_uInt64 InfiniteTimeoutMs = 1000 * 60 * 60 * 24; // 1 day
static void ImplStartTimer(sal_uInt64 nMS, bool bForce = false);
@@ -84,7 +85,7 @@ public:
Scheduler& operator=( const Scheduler& rScheduler );
static void ImplDeInitScheduler();
- // Process one pending Timer with highhest priority
+ /// Process one pending Timer with highhest priority
static void CallbackTaskScheduling( bool ignore );
/// Calculate minimum timeout - and return its value.
static sal_uInt64 CalculateMinimumTimeout( bool &bHasActiveIdles );
@@ -92,6 +93,12 @@ public:
static bool ProcessTaskScheduling( bool bTimerOnly );
/// Process all events until we are idle
static void ProcessEventsToIdle();
+
+ /// Control the deterministic mode. In this mode, two subsequent runs of
+ /// LibreOffice fire about the same amount idles.
+ static void SetDeterministicMode(bool bDeterministic);
+ /// Return the current state of deterministic mode.
+ static bool GetDeterministicMode();
};
#endif // INCLUDED_VCL_SCHEDULER_HXX