Make PosixLogger::flush_pending_ atomic

Summary:
TSAN sometimes complaints data race of PosixLogger::flush_pending_. Make it atomic.
Closes https://github.com/facebook/rocksdb/pull/2231

Differential Revision: D4973397

Pulled By: siying

fbshipit-source-id: 571e886e3eca3231705919d573e250c1c1ec3764
main
Siying Dong 8 years ago committed by Facebook Github Bot
parent da4b2070b3
commit a2b05210ef
  1. 2
      env/posix_logger.h

@ -41,7 +41,7 @@ class PosixLogger : public Logger {
const static uint64_t flush_every_seconds_ = 5;
std::atomic_uint_fast64_t last_flush_micros_;
Env* env_;
bool flush_pending_;
std::atomic<bool> flush_pending_;
public:
PosixLogger(FILE* f, uint64_t (*gettid)(), Env* env,
const InfoLogLevel log_level = InfoLogLevel::ERROR_LEVEL)

Loading…
Cancel
Save