Add a task to the thread pool.
| 81 | |
| 82 | // Add a task to the thread pool. |
| 83 | void AddTask(const Task& task) { |
| 84 | MutexLock lock(&mutex_, "AddTask"); |
| 85 | queue_.push_back(BGItem(0, get_micros(), task)); |
| 86 | ++pending_num_; |
| 87 | work_cv_.Signal(); |
| 88 | } |
| 89 | void AddPriorityTask(const Task& task) { |
| 90 | MutexLock lock(&mutex_); |
| 91 | queue_.push_front(BGItem(0, get_micros(), task)); |