Go to the documentation of this file.
19 #ifndef GRPC_SUPPORT_ATM_GCC_SYNC_H
20 #define GRPC_SUPPORT_ATM_GCC_SYNC_H
27 #define GPR_ATM_MAX INTPTR_MAX
28 #define GPR_ATM_MIN INTPTR_MIN
30 #define GPR_ATM_COMPILE_BARRIER_() __asm__ __volatile__("" : : : "memory")
32 #if defined(__i386) || defined(__x86_64__)
34 #define GPR_ATM_LS_BARRIER_() GPR_ATM_COMPILE_BARRIER_()
36 #define GPR_ATM_LS_BARRIER_() gpr_atm_full_barrier()
39 #define gpr_atm_full_barrier() (__sync_synchronize())
63 #undef GPR_ATM_LS_BARRIER_
64 #undef GPR_ATM_COMPILE_BARRIER_
66 #define gpr_atm_no_barrier_fetch_add(p, delta) \
67 gpr_atm_full_fetch_add((p), (delta))
68 #define gpr_atm_full_fetch_add(p, delta) (__sync_fetch_and_add((p), (delta)))
70 #define gpr_atm_no_barrier_cas(p, o, n) gpr_atm_acq_cas((p), (o), (n))
71 #define gpr_atm_acq_cas(p, o, n) (__sync_bool_compare_and_swap((p), (o), (n)))
72 #define gpr_atm_rel_cas(p, o, n) gpr_atm_acq_cas((p), (o), (n))
73 #define gpr_atm_full_cas(p, o, n) gpr_atm_acq_cas((p), (o), (n))
intptr_t gpr_atm
Definition: atm_gcc_sync.h:26
#define gpr_atm_acq_load(p)
Definition: atm_gcc_atomic.h:38
#define gpr_atm_no_barrier_load(p)
Definition: atm_gcc_atomic.h:39
#define gpr_atm_rel_cas(p, o, n)
Definition: atm_gcc_sync.h:72
intptr_t gpr_atm
Definition: atm_gcc_atomic.h:32
#define GPR_ATM_LS_BARRIER_()
Definition: atm_gcc_sync.h:36
#define gpr_atm_full_xchg(p, n)
Definition: atm_gcc_atomic.h:78
#define gpr_atm_no_barrier_store(p, value)
Definition: atm_gcc_atomic.h:42
#define GPR_ATM_COMPILE_BARRIER_()
Definition: atm_gcc_sync.h:30
#define gpr_atm_rel_store(p, value)
Definition: atm_gcc_atomic.h:40