summaryrefslogtreecommitdiff
path: root/include/vcl/idle.hxx
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2017-01-25 15:53:15 +0100
committerJan-Marek Glogowski <glogow@fbihome.de>2017-07-13 12:10:23 +0200
commit917be98e3f277960635ac66bcea510c2454c80d6 (patch)
tree18def396ae400eb1151211c863d44be457a7831a /include/vcl/idle.hxx
parent23beae53b43484d82949019a3279362c7e1dfb4b (diff)
Round-robin invoked tasks
Add some round-robin to the task processing, so equal priority (auto) tasks won't always be scheduled, if there are multiple tasks with the same priority. Change-Id: Ice111aa5f85e9181b3ee9799ca4df0d58f210fe9
Diffstat (limited to 'include/vcl/idle.hxx')
-rw-r--r--include/vcl/idle.hxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/vcl/idle.hxx b/include/vcl/idle.hxx
index 157d14d96816..cb96c09864c5 100644
--- a/include/vcl/idle.hxx
+++ b/include/vcl/idle.hxx
@@ -46,6 +46,22 @@ public:
virtual void Start() override;
};
+/**
+ * An auto-idle is long running task processing small chunks of data, which
+ * is re-scheduled multiple times.
+ *
+ * Remember to stop the Idle when finished, as it would otherwise busy loop the CPU!
+ *
+ * It probably makes sense to re-implement ReadyForSchedule and UpdateMinPeriod,
+ * in case there is a quick check and it can otherwise sleep.
+ */
+class VCL_DLLPUBLIC AutoIdle : public Idle
+{
+public:
+ AutoIdle( const sal_Char *pDebugName = nullptr );
+};
+
+
#endif // INCLUDED_VCL_IDLE_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */