X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2Ftest%2FRWSpinLockTest.cpp;h=8c031f17275772f4ab910e0ee8f6f6e9da4aeefa;hb=db13010c1338d471c713a652e0940afba627b8bc;hp=a6a40415b4c00a3e5fdc777980a7068ef7a1a88d;hpb=35fcff936a0ba58986269fb05689843f99e89eb5;p=folly.git diff --git a/folly/test/RWSpinLockTest.cpp b/folly/test/RWSpinLockTest.cpp index a6a40415..8c031f17 100644 --- a/folly/test/RWSpinLockTest.cpp +++ b/folly/test/RWSpinLockTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2016 Facebook, Inc. + * Copyright 2017 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,13 +21,13 @@ #include #include -#include #include +#include #include -#include #include +#include #include DEFINE_int32(num_threads, 8, "num threads"); @@ -38,7 +38,7 @@ static const int kMaxReaders = 50; static std::atomic stopThread; using namespace folly; -template struct RWSpinLockTest: public testing::Test { +template struct RWSpinLockTest: public testing::Test { typedef RWSpinLockT RWSpinLockType; }; @@ -53,7 +53,7 @@ typedef testing::Types +template static void run(RWSpinLockType* lock) { int64_t reads = 0; int64_t writes = 0; @@ -228,11 +228,13 @@ TEST(RWSpinLock, concurrent_holder_test) { sleep(5); stop.store(true, std::memory_order_release); - for (auto& t : threads) t.join(); + for (auto& t : threads) { + t.join(); + } LOG(INFO) << "reads: " << reads.load(std::memory_order_acquire) << "; writes: " << writes.load(std::memory_order_acquire) << "; upgrades: " << upgrades.load(std::memory_order_acquire); } -} +} // namespace