File tree 2 files changed +21
-21
lines changed
2 files changed +21
-21
lines changed Original file line number Diff line number Diff line change 1
- #pragma once
2
-
3
- #include <stdatomic.h>
4
- #include <stdbool.h>
5
- #include <stdlib.h>
6
- #include <string.h>
7
-
8
- #define ATOMIC_SUB atomic_fetch_sub
9
- #define CAS atomic_compare_exchange_strong
10
-
11
- /* The 2nd argument is limited to 1 on machines with TAS but not XCHG.
12
- * On x86 it is an arbitrary value.
13
- */
14
- #define XCHG atomic_exchange
15
- #define ATOMIC_ADD atomic_fetch_add
16
- #define mb () atomic_thread_fence(memory_order_seq_cst)
17
-
18
- /* Memory barriers*/
19
- #define smp_mb () atomic_thread_fence(memory_order_seq_cst)
20
- #define smp_rmb () atomic_thread_fence(memory_order_acquire)
21
- #define smp_wmb () atomic_thread_fence(memory_order_release)
1
+ #pragma once
2
+
3
+ #include <stdatomic.h>
4
+ #include <stdbool.h>
5
+ #include <stdlib.h>
6
+ #include <string.h>
7
+
8
+ #define ATOMIC_SUB atomic_fetch_sub
9
+ #define CAS atomic_compare_exchange_strong
10
+
11
+ /* The 2nd argument is limited to 1 on machines with TAS but not XCHG.
12
+ * On x86 it is an arbitrary value.
13
+ */
14
+ #define XCHG atomic_exchange
15
+ #define ATOMIC_ADD atomic_fetch_add
16
+ #define mb () atomic_thread_fence(memory_order_seq_cst)
17
+
18
+ /* Memory barriers*/
19
+ #define smp_mb () atomic_thread_fence(memory_order_seq_cst)
20
+ #define smp_rmb () atomic_thread_fence(memory_order_acquire)
21
+ #define smp_wmb () atomic_thread_fence(memory_order_release)
You can’t perform that action at this time.
0 commit comments