Add data structure benchmarks
[c11concurrency-benchmarks.git] / cdschecker_modified_benchmarks / include / cds_atomic.h
1 #ifndef __STDATOMIC_H__
2 #define __STDATOMIC_H__
3
4 #ifdef __cplusplus
5
6 #include <atomic>
7
8 using std::atomic_flag;
9 using std::atomic_bool;
10 //using std::atomic_address;
11 using std::atomic_char;
12 using std::atomic_schar;
13 using std::atomic_uchar;
14 using std::atomic_short;
15 using std::atomic_ushort;
16 using std::atomic_int;
17 using std::atomic_uint;
18 using std::atomic_long;
19 using std::atomic_ulong;
20 using std::atomic_llong;
21 using std::atomic_ullong;
22 using std::atomic_wchar_t;
23
24 using std::atomic_size_t;
25 using std::atomic_uintptr_t;
26
27 using std::atomic;
28 using std::memory_order;
29 using std::memory_order_relaxed;
30 using std::memory_order_acquire;
31 using std::memory_order_release;
32 using std::memory_order_acq_rel;
33 using std::memory_order_seq_cst;
34
35 using std::atomic_thread_fence;
36 using std::atomic_signal_fence;
37
38 using std::atomic_init;
39
40 #define atomic_init(A, V) *A=V
41
42 #define atomic_load_explicit(A, MO) (*A).load(MO)
43 #define atomic_store_explicit(A, V, MO) (*A).store(V, MO)
44
45 #define atomic_fetch_add_explicit(A, V, MO) (*A).fetch_add(V, MO);
46 #define atomic_fetch_sub_explicit(A, V, MO) (*A).fetch_sub(V, MO);
47 #define atomic_compare_exchange_strong_explicit(A, E, V, MO, FMO) \
48     (*A).compare_exchange_strong(*E, V, MO, FMO)
49
50 #endif
51
52 #endif  // __STDATOMIC_H__