Lines Matching refs:task

17 #include "webrtc/base/task.h"
39 void TaskRunner::StartTask(Task * task) {
40 tasks_.push_back(task);
42 // the task we just started could be about to timeout --
43 // make sure our "next timeout task" is correct
44 UpdateTaskTimeout(task, 0);
58 // Subsequent use of those task may cause data corruption or crashes.
84 Task* task = tasks_[i];
86 task->unique_id() == next_timeout_task_->unique_id()) {
92 deleting_task_ = task;
94 delete task;
122 // see if our "next potentially timed-out task" has indeed timed out.
123 // If it has, wake it up, then queue up the next task in line
145 // this function gets called frequently -- when each task changes
148 // the next timeout-able task hasn't changed. The logic in this function
150 // effectively making the task scheduler O-1 instead of O-N
152 void TaskRunner::UpdateTaskTimeout(Task* task,
154 ASSERT(task != NULL);
157 task->unique_id() == next_timeout_task_->unique_id();
162 // if the relevant task has a timeout, then
164 // "about to timeout" task
165 if (task->timeout_time()) {
167 (task->timeout_time() <= next_timeout_task_->timeout_time())) {
168 next_timeout_task_ = task;
171 // otherwise, if the task doesn't have a timeout,
172 // and it used to be our "about to timeout" task,
174 // "about to timeout" task
175 RecalcNextTimeout(task);
197 Task *task = tasks_[i];
198 // if the task isn't complete, and it actually has a timeout time
199 if (!task->IsDone() && (task->timeout_time() > 0))
200 // if it doesn't match our "exclude" task
202 exclude_task->unique_id() != task->unique_id())
205 task->timeout_time() <= next_timeout_time) {
206 // set this task as our next-to-timeout
207 next_timeout_time = task->timeout_time();
208 next_timeout_task_ = task;