Fix a flaky tsan test for DBTest2 (#7526)

Summary:
ThreadSanitizer: data race for `DummyOldStats.num_rt`.
Failed build: https://app.circleci.com/pipelines/github/facebook/rocksdb/3991/workflows/b47c3ae1-5531-4489-ac51-11854abdfd0f/jobs/42305

Pull Request resolved: https://github.com/facebook/rocksdb/pull/7526

Reviewed By: akankshamahajan15

Differential Revision: D24226736

Pulled By: jay-zhuang

fbshipit-source-id: e05ce354d0c0db0eba242d59d4b0e89ce7c25acf
This commit is contained in:
Jay Zhuang 2020-10-12 11:20:45 -07:00 committed by Facebook GitHub Bot
parent cb2581031a
commit f548a2a03c

View File

@ -4376,8 +4376,8 @@ class DummyOldStats : public Statistics {
}
bool HistEnabledForType(uint32_t /*type*/) const override { return false; }
std::string ToString() const override { return ""; }
int num_rt = 0;
int num_mt = 0;
std::atomic<int> num_rt{0};
std::atomic<int> num_mt{0};
};
} // namespace