Lines Matching refs:task
67 void WatchdogInner::RunOneShotTask(const std::string& name, Task&& task, uint64_t delay) in RunOneShotTask() argument
69 if (name.empty() || task == nullptr) { in RunOneShotTask()
79 InsertWatchdogTaskLocked(name, WatchdogTask(name, std::move(task), delay, 0, true)); in RunOneShotTask()
82 void WatchdogInner::RunPeriodicalTask(const std::string& name, Task&& task, uint64_t interval, uint… in RunPeriodicalTask() argument
84 if (name.empty() || task == nullptr) { in RunPeriodicalTask()
95 InsertWatchdogTaskLocked(name, WatchdogTask(name, std::move(task), delay, interval, false)); in RunPeriodicalTask()
117 bool WatchdogInner::InsertWatchdogTaskLocked(const std::string& name, WatchdogTask&& task) in InsertWatchdogTaskLocked() argument
119 if (!task.isOneshotTask && IsTaskExistLocked(name)) { in InsertWatchdogTaskLocked()
129 checkerQueue_.push(std::move(task)); in InsertWatchdogTaskLocked()
130 if (!task.isOneshotTask) { in InsertWatchdogTaskLocked()
153 uint64_t WatchdogInner::FetchNextTask(uint64_t now, WatchdogTask& task) in FetchNextTask() argument
172 task = queuedTask; in FetchNextTask()
177 void WatchdogInner::ReInsertTaskIfNeed(WatchdogTask& task) in ReInsertTaskIfNeed() argument
179 if (task.checkInterval == 0) { in ReInsertTaskIfNeed()
184 task.nextTickTime = task.nextTickTime + task.checkInterval; in ReInsertTaskIfNeed()
185 checkerQueue_.push(task); in ReInsertTaskIfNeed()
194 WatchdogTask task; in Start() local
195 uint64_t leftTimeMill = FetchNextTask(now, task); in Start()
197 task.Run(now); in Start()
198 ReInsertTaskIfNeed(task); in Start()