Refactors Rcu test case
[folly.git] / folly / stress-test / sync_test.h
1 #ifndef _FOLLY_SYNC_TEST_H
2 #define _FOLLY_SYNC_TEST_H
3
4 #include <folly/SmallLocks.h>
5 #include <folly/RWSpinLock.h>
6 #include <folly/SharedMutex.h>
7 #include <folly/synchronization/Rcu.h>
8
9 #include <cds_test/stress_test.h>
10 #include <cds_test/stress_test_util.h>
11
12 #include <algorithm>
13 #include <iostream>
14 #include <memory>
15 #include <random>
16 #include <thread>
17 #include <chrono>
18
19 namespace folly_test {
20
21 typedef folly::MicroLock MicroLock;
22 typedef folly::MicroSpinLock MicroSpinLock;
23 typedef folly::PicoSpinLock<size_t> PicoSpinLock;
24 typedef folly::SharedMutexReadPriority SharedMutexReadPriority;
25 typedef folly::SharedMutexWritePriority SharedMutexWritePriority;
26 typedef folly::RWSpinLock RWSpinLock;
27 typedef folly::RWTicketSpinLock32 RWTicketSpinLock32;
28 typedef folly::RWTicketSpinLock64 RWTicketSpinLock64;
29
30 // Represent the RCU-protected data.
31 struct RcuData {
32   size_t d1;
33   size_t d2;
34 };
35
36 } // namespace folly_test
37
38 #endif