-#define LOCK_TEST(lock_type, lock_ptr) \
- TEST_F(SpinLockTest, lock_type) { \
- lock_ptr = new lock_type(); \
- std::thread threads[kThreads]; \
- for (int i = 0; i < kThreads; i++) { \
- threads[i] = std::thread(Thread ## lock_type); \
- } \
- for (int i = 0; i < kThreads; i++) { \
- threads[i].join(); \
- } \
-}
+#define LOCK_TEST(lock_type, lock_ptr) \
+ TEST_F(SpinLockTest, lock_type) { \
+ lock_ptr = new lock_type(); \
+ std::thread *threads = new std::thread[s_nSpinLockThreadCount]; \
+ for (int i = 0; i < s_nSpinLockThreadCount; i++) { \
+ threads[i] = std::thread(Thread##lock_type); \
+ } \
+ for (int i = 0; i < s_nSpinLockThreadCount; i++) { \
+ threads[i].join(); \
+ } \
+ }