X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2Ftest%2FSmallLocksTest.cpp;h=32a20d77fa3cc54f31ac2ba6b4655e0c5f4381e9;hb=192d78d40551ec5d9aade5ca72dd6e33ad700a2b;hp=9da8b2bd098c223e7cec110878fd0b41b8199a50;hpb=a0c640e8e2ff45bc43b9f8d96cd108bb66635bee;p=folly.git diff --git a/folly/test/SmallLocksTest.cpp b/folly/test/SmallLocksTest.cpp index 9da8b2bd..32a20d77 100644 --- a/folly/test/SmallLocksTest.cpp +++ b/folly/test/SmallLocksTest.cpp @@ -16,20 +16,20 @@ #include -#include - #include +#include #include #include -#include #include +#include #include -#include -#include +#include +#include #include #include +#include #include using folly::MSLGuard; @@ -71,7 +71,7 @@ void splock_test() { const int max = 1000; auto rng = folly::ThreadLocalPRNG(); for (int i = 0; i < max; i++) { - folly::asm_pause(); + folly::asm_volatile_pause(); MSLGuard g(v.lock); int first = v.ar[0]; @@ -85,7 +85,7 @@ void splock_test() { } #ifdef FOLLY_PICO_SPIN_LOCK_H_ -template struct PslTest { +template struct PslTest { PicoSpinLock lock; PslTest() { lock.init(); } @@ -104,7 +104,7 @@ template struct PslTest { } }; -template +template void doPslTest() { PslTest testObj; @@ -135,7 +135,7 @@ struct TestClobber { MicroSpinLock lock_; }; -} +} // namespace TEST(SmallLocks, SpinLockCorrectness) { EXPECT_EQ(sizeof(MicroSpinLock), 1); @@ -216,7 +216,7 @@ struct SimpleBarrier { std::condition_variable cv_; bool ready_; }; -} +} // namespace TEST(SmallLocks, MicroLock) { volatile uint64_t counters[4] = {0, 0, 0, 0};