| 36 | } |
| 37 | |
| 38 | Status Coordinator::RegisterRunner(std::unique_ptr<RunnerInterface> runner) { |
| 39 | { |
| 40 | mutex_lock l(mu_); |
| 41 | if (should_stop_) { |
| 42 | return Status(error::FAILED_PRECONDITION, |
| 43 | "The coordinator has been stopped."); |
| 44 | } |
| 45 | } |
| 46 | mutex_lock l(runners_lock_); |
| 47 | runners_.push_back(std::move(runner)); |
| 48 | return Status::OK(); |
| 49 | } |
| 50 | |
| 51 | bool Coordinator::AllRunnersStopped() { |
| 52 | mutex_lock l(runners_lock_); |