diff options
author | Ashod Nakashian <ashodnakashian@yahoo.com> | 2015-07-19 19:40:18 -0400 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-09-04 18:43:41 +0000 |
commit | 6d64d2f38d9f6c2f54e05675ecd0709eabf6d8ca (patch) | |
tree | 24d40b7cf724ef0946418c748338287252c24c24 /include/vcl/scheduler.hxx | |
parent | 27949c810daa4090106cbed360f80869a4813d15 (diff) |
Minor refactoring and cleanup of Scheduler and Timer.
Members are now const-correct.
Replaced compile-time constants with enum.
Refactored common functions from Timer to Scheduler.
Disabled timer-precision unittests as they misfire often.
These changes are non-functional.
Change-Id: I6bb3d9fc402cadd556d9063ed9a4888f114c73d7
Reviewed-on: https://gerrit.libreoffice.org/17977
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'include/vcl/scheduler.hxx')
-rw-r--r-- | include/vcl/scheduler.hxx | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/include/vcl/scheduler.hxx b/include/vcl/scheduler.hxx index c4d093712729..612bd08999b4 100644 --- a/include/vcl/scheduler.hxx +++ b/include/vcl/scheduler.hxx @@ -51,23 +51,32 @@ enum class SchedulerPriority { class VCL_DLLPUBLIC Scheduler { +private: + static void InitSystemTimer(ImplSVData* pSVData); + protected: ImplSchedulerData* mpSchedulerData; /// Pointer to element in scheduler list const sal_Char *mpDebugName; /// Useful for debugging SchedulerPriority mePriority; /// Scheduler priority bool mbActive; /// Currently in the scheduler + // These should be constexpr static, when supported. + static const sal_uInt64 ImmediateTimeoutMs = 1; + static const sal_uInt64 MaximumTimeoutMs = SAL_MAX_UINT64; + + static void ImplStartTimer(sal_uInt64 nMS); + friend struct ImplSchedulerData; virtual void SetDeletionFlags(); - virtual bool ReadyForSchedule( bool bTimer ) = 0; - virtual sal_uInt64 UpdateMinPeriod( sal_uInt64 nMinPeriod, sal_uInt64 nTime ) = 0; + virtual bool ReadyForSchedule( bool bTimer ) const = 0; + virtual sal_uInt64 UpdateMinPeriod( sal_uInt64 nMinPeriod, sal_uInt64 nTime ) const = 0; public: Scheduler( const sal_Char *pDebugName = NULL ); Scheduler( const Scheduler& rScheduler ); virtual ~Scheduler(); - void SetPriority( SchedulerPriority ePriority ); + void SetPriority(SchedulerPriority ePriority) { mePriority = ePriority; } SchedulerPriority GetPriority() const { return mePriority; } void SetDebugName( const sal_Char *pDebugName ) { mpDebugName = pDebugName; } @@ -80,7 +89,7 @@ public: bool IsActive() const { return mbActive; } - Scheduler& operator=( const Scheduler& rScheduler ); + Scheduler& operator=( const Scheduler& rScheduler ); static void ImplDeInitScheduler(); // Process one pending Timer with highhest priority |