| 130 | } |
| 131 | |
| 132 | Status SchedulerThread::Shutdown() { |
| 133 | if (thread_) { |
| 134 | shutdown_.CountDown(); |
| 135 | thread_->Join(); |
| 136 | } |
| 137 | return Status::OK(); |
| 138 | } |
| 139 | |
| 140 | void SchedulerThread::RunLoop() { |
| 141 | while (!shutdown_.WaitFor(MonoDelta::FromMilliseconds(schedule_period_ms_))) { |