| 1772 | bool TaskIsRunning() const { return task_finished.is_valid(); } |
| 1773 | |
| 1774 | bool NeedsRestart() const { |
| 1775 | return !finished && !reading && static_cast<int>(queue.size()) <= q_restart; |
| 1776 | } |
| 1777 | |
| 1778 | void DoRestartTask(std::shared_ptr<State> state, util::Mutex::Guard guard) { |
| 1779 | // If we get here we are actually going to start a new task so let's create a |