diff options
author | Tobias Madl <tobias.madl.dev@gmail.com> | 2015-01-16 13:28:29 +0000 |
---|---|---|
committer | Tobias Madl <tobias.madl.dev@gmail.com> | 2015-03-06 12:27:06 +0000 |
commit | 4c3cea26b84cc70a67ff4eda99b842d8786a3628 (patch) | |
tree | bc11a3a141774c7be7e62d9e43a4cd937a298025 /include/vcl/idle.hxx | |
parent | 256c5c3f28ef70b70d38e2e07dfca4baab654612 (diff) |
Scheduling optimization and starving protection
If a Timeout appears, while the idle scheduling is in progress.
The idle scheduler gets interrupted and the timeouts are handled.
Now the idle scheduler has a new starving protection.
Change-Id: Ic9081c647e3fb0abf3b0dc014e711a3b97e0e37d
Diffstat (limited to 'include/vcl/idle.hxx')
-rw-r--r-- | include/vcl/idle.hxx | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/include/vcl/idle.hxx b/include/vcl/idle.hxx index 9da841490f2f..da0a5c7e89fd 100644 --- a/include/vcl/idle.hxx +++ b/include/vcl/idle.hxx @@ -28,14 +28,16 @@ struct ImplIdleData; struct ImplSVData; enum class IdlePriority { - VCL_IDLE_PRIORITY_HIGHEST = 0, // -> 0ms - VCL_IDLE_PRIORITY_HIGH = 1, // -> 1ms - VCL_IDLE_PRIORITY_REPAINT = 2, // -> 30ms - VCL_IDLE_PRIORITY_RESIZE = 3, // -> 50ms - VCL_IDLE_PRIORITY_MEDIUM = 4, // -> 50ms - VCL_IDLE_PRIORITY_LOW = 5, // -> 100ms - VCL_IDLE_PRIORITY_LOWER = 6, // -> 200ms - VCL_IDLE_PRIORITY_LOWEST = 7 // -> 400ms + VCL_IDLE_PRIORITY_STARVATIONPROTECTION = -1, // Do not use this for normal prioritizing + VCL_IDLE_PRIORITY_HIGHEST = 0, // -> 0ms + VCL_IDLE_PRIORITY_HIGH = 1, // -> 1ms + VCL_IDLE_PRIORITY_DEFAULT = 1, // -> 1ms + VCL_IDLE_PRIORITY_REPAINT = 2, // -> 30ms + VCL_IDLE_PRIORITY_RESIZE = 3, // -> 50ms + VCL_IDLE_PRIORITY_MEDIUM = 3, // -> 50ms + VCL_IDLE_PRIORITY_LOW = 5, // -> 100ms + VCL_IDLE_PRIORITY_LOWER = 6, // -> 200ms + VCL_IDLE_PRIORITY_LOWEST = 7 // -> 400ms }; @@ -46,6 +48,7 @@ class VCL_DLLPUBLIC Idle protected: ImplIdleData* mpIdleData; IdlePriority mePriority; + IdlePriority meDefaultPriority; bool mbActive; Link maIdleHdl; @@ -56,8 +59,9 @@ public: Idle( const Idle& rIdle ); virtual ~Idle(); - void SetPriority( IdlePriority ePriority ) { mePriority = ePriority; } + void SetPriority( IdlePriority ePriority ); IdlePriority GetPriority() const { return mePriority; } + IdlePriority GetDefaultPriority() const { return meDefaultPriority; } /// Make it possible to associate a callback with this idle handler /// of course, you can also sub-class and override 'DoIdle' |