| 59 | } |
| 60 | |
| 61 | Status Coordinator::RequestStop() { |
| 62 | mutex_lock l(mu_); |
| 63 | if (should_stop_) { |
| 64 | return Status(error::FAILED_PRECONDITION, |
| 65 | "The Coordinator is not running."); |
| 66 | } |
| 67 | should_stop_ = true; |
| 68 | wait_for_stop_.notify_all(); |
| 69 | return Status::OK(); |
| 70 | } |
| 71 | |
| 72 | bool Coordinator::ShouldStop() { |
| 73 | mutex_lock l(mu_); |