summaryrefslogtreecommitdiff
path: root/include/vcl/task.hxx
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2017-01-29 17:12:25 +0100
committerJan-Marek Glogowski <glogow@fbihome.de>2017-07-13 12:10:28 +0200
commit11ffb51b758cd18a2c61d4bfa694f9f031ecd096 (patch)
tree4ff9890da8805fa5a6a15ab3243eaa556f9ac5d8 /include/vcl/task.hxx
parentb4cc0f2d3fb9cc85e5ea7b157ec35b01c1868d50 (diff)
Drop Task::ReadyForSchedule
All relevant information is also provided by UpdateMinPeriod and the calculations were even duplicated. This also includes dropping Scheduler::UpdateMinPeriod, as this is now reduced to a simple comparison and assignment, as we simply ignore larger returned sleep times. Change-Id: I13852e3e63daead451bf7fcb98be9b1d44bd7abd
Diffstat (limited to 'include/vcl/task.hxx')
-rw-r--r--include/vcl/task.hxx15
1 files changed, 11 insertions, 4 deletions
diff --git a/include/vcl/task.hxx b/include/vcl/task.hxx
index 21eb934fee6d..5148ac31bebf 100644
--- a/include/vcl/task.hxx
+++ b/include/vcl/task.hxx
@@ -56,11 +56,18 @@ protected:
const ImplSchedulerData* GetSchedulerData() const { return mpSchedulerData; }
virtual void SetDeletionFlags();
- /// Is this item ready to be dispatched at nTimeNow
- virtual bool ReadyForSchedule( sal_uInt64 nTimeNow ) const = 0;
+
/**
- * Adjust nMinPeriod downwards if we want to be notified before
- * then, nTimeNow is the current time.
+ * How long (in MS) until the Task is ready to be dispatched?
+ *
+ * Simply return Scheduler::ImmediateTimeoutMs if you're ready, like an
+ * Idle. If you have to return Scheduler::InfiniteTimeoutMs, you probably
+ * need an other mechanism to wake up the Scheduler or rely on other
+ * Tasks to be scheduled, or simply use a polling Timer.
+ *
+ * @param nMinPeriod the currently expected sleep time
+ * @param nTimeNow the current time
+ * @return the sleep time of the Task to become ready
*/
virtual sal_uInt64 UpdateMinPeriod( sal_uInt64 nMinPeriod, sal_uInt64 nTimeNow ) const = 0;