| 47 | } |
| 48 | |
| 49 | void AsyncLogger::Stop() { |
| 50 | { |
| 51 | MutexLock l(lock_); |
| 52 | CHECK_EQ(state_, RUNNING); |
| 53 | state_ = STOPPED; |
| 54 | wake_flusher_cond_.Signal(); |
| 55 | } |
| 56 | thread_.join(); |
| 57 | CHECK(active_buf_->messages.empty()); |
| 58 | CHECK(flushing_buf_->messages.empty()); |
| 59 | } |
| 60 | |
| 61 | void AsyncLogger::Write(bool force_flush, |
| 62 | time_t timestamp, |