Commit 2d253fd0 authored by Dan Melnic's avatar Dan Melnic Committed by Facebook Github Bot

Init the std::atomic since in the default constructor is "no initialization takes place"

Summary: Init the std::atomic since in the default constructor is "no initialization takes place"

Reviewed By: yfeldblum, djwatson

Differential Revision: D9515004

fbshipit-source-id: cdc73c490f77496335e77732b0c7c43c180a54b6
parent c89fa5fd
...@@ -516,7 +516,7 @@ TEST_F(HazptrTest, mt_refcount) { ...@@ -516,7 +516,7 @@ TEST_F(HazptrTest, mt_refcount) {
std::atomic<bool> ready(false); std::atomic<bool> ready(false);
std::atomic<int> setHazptrs(0); std::atomic<int> setHazptrs(0);
std::atomic<Foo*> head; std::atomic<Foo*> head{nullptr};
int num = 20; int num = 20;
int nthr = 10; int nthr = 10;
......
...@@ -246,7 +246,7 @@ void contendedRW(size_t itersPerThread, ...@@ -246,7 +246,7 @@ void contendedRW(size_t itersPerThread,
typedef AtomicUnorderedInsertMap<Key,MutableAtom<uint32_t>,PairHash> Map; typedef AtomicUnorderedInsertMap<Key,MutableAtom<uint32_t>,PairHash> Map;
std::unique_ptr<Map> ptr = {}; std::unique_ptr<Map> ptr = {};
std::atomic<bool> go; std::atomic<bool> go{false};
std::vector<std::thread> threads; std::vector<std::thread> threads;
BENCHMARK_SUSPEND { BENCHMARK_SUSPEND {
......
...@@ -530,7 +530,7 @@ TEST(Singleton, SingletonEagerInitParallel) { ...@@ -530,7 +530,7 @@ TEST(Singleton, SingletonEagerInitParallel) {
const static size_t kIters = 1000; const static size_t kIters = 1000;
const static size_t kThreads = 20; const static size_t kThreads = 20;
std::atomic<size_t> initCounter; std::atomic<size_t> initCounter{0};
auto& vault = *SingletonVault::singleton<EagerInitParallelTag>(); auto& vault = *SingletonVault::singleton<EagerInitParallelTag>();
......
...@@ -335,8 +335,7 @@ TEST(ThreadLocalPtr, AccessAllThreadsCounter) { ...@@ -335,8 +335,7 @@ TEST(ThreadLocalPtr, AccessAllThreadsCounter) {
const int kNumThreads = 256; const int kNumThreads = 256;
SimpleThreadCachedInt stci[kNumThreads + 1]; SimpleThreadCachedInt stci[kNumThreads + 1];
std::atomic<bool> run(true); std::atomic<bool> run(true);
std::atomic<int> totalAtomic; std::atomic<int> totalAtomic{0};
;
std::vector<std::thread> threads; std::vector<std::thread> threads;
// thread i will increment all the thread locals // thread i will increment all the thread locals
// in the range 0..i // in the range 0..i
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment