mirror of https://github.com/facebook/rocksdb.git
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
This commit is contained in:
parent
da4b2070b3
commit
a2b05210ef
|
@ -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…
Reference in New Issue