[Base] Properly flush remaining writes out before shutting down logging.

This commit is contained in:
gibbed 2018-11-24 08:54:46 -06:00
parent 24dd0267bf
commit fb50f02a98
1 changed files with 4 additions and 1 deletions

View File

@ -156,9 +156,12 @@ class Logger {
void WriteThread() {
RingBuffer rb(buffer_, kBufferSize);
uint32_t idle_loops = 0;
while (running_) {
while (true) {
bool did_write = false;
rb.set_write_offset(write_tail_);
if (!running_ && rb.empty()) {
break;
}
while (!rb.empty()) {
did_write = true;