#include <folly/SmallLocks.h>
-#include <pthread.h>
-
#include <cassert>
#include <condition_variable>
#include <cstdio>
#include <thread>
#include <vector>
+#include <glog/logging.h>
+
#include <folly/Random.h>
#include <folly/portability/Asm.h>
#include <folly/portability/GTest.h>
+#include <folly/portability/PThread.h>
#include <folly/portability/Unistd.h>
using folly::MSLGuard;
}
#ifdef FOLLY_PICO_SPIN_LOCK_H_
-template<class T> struct PslTest {
+template <class T> struct PslTest {
PicoSpinLock<T> lock;
PslTest() { lock.init(); }
}
};
-template<class T>
+template <class T>
void doPslTest() {
PslTest<T> testObj;
MicroSpinLock lock_;
};
-}
+} // namespace
TEST(SmallLocks, SpinLockCorrectness) {
EXPECT_EQ(sizeof(MicroSpinLock), 1);
std::condition_variable cv_;
bool ready_;
};
-}
+} // namespace
TEST(SmallLocks, MicroLock) {
volatile uint64_t counters[4] = {0, 0, 0, 0};