Go to the documentation of this file.
19 #ifndef GRPC_IMPL_CODEGEN_ATM_GCC_SYNC_H
20 #define GRPC_IMPL_CODEGEN_ATM_GCC_SYNC_H
27 #define GPR_ATM_MAX INTPTR_MAX
28 #define GPR_ATM_MIN INTPTR_MIN
29 #define GPR_ATM_INC_CAS_THEN(blah) blah
30 #define GPR_ATM_INC_ADD_THEN(blah) blah
32 #define GPR_ATM_COMPILE_BARRIER_() __asm__ __volatile__("" : : : "memory")
34 #if defined(__i386) || defined(__x86_64__)
36 #define GPR_ATM_LS_BARRIER_() GPR_ATM_COMPILE_BARRIER_()
38 #define GPR_ATM_LS_BARRIER_() gpr_atm_full_barrier()
41 #define gpr_atm_full_barrier() (__sync_synchronize())
65 #undef GPR_ATM_LS_BARRIER_
66 #undef GPR_ATM_COMPILE_BARRIER_
68 #define gpr_atm_no_barrier_fetch_add(p, delta) \
69 gpr_atm_full_fetch_add((p), (delta))
70 #define gpr_atm_full_fetch_add(p, delta) (__sync_fetch_and_add((p), (delta)))
72 #define gpr_atm_no_barrier_cas(p, o, n) gpr_atm_acq_cas((p), (o), (n))
73 #define gpr_atm_acq_cas(p, o, n) (__sync_bool_compare_and_swap((p), (o), (n)))
74 #define gpr_atm_rel_cas(p, o, n) gpr_atm_acq_cas((p), (o), (n))
75 #define gpr_atm_full_cas(p, o, n) gpr_atm_acq_cas((p), (o), (n))
#define GPR_ATM_COMPILE_BARRIER_()
Definition: atm_gcc_sync.h:32
#define gpr_atm_no_barrier_load(p)
Definition: atm_gcc_atomic.h:51
#define gpr_atm_no_barrier_store(p, value)
Definition: atm_gcc_atomic.h:54
#define GPR_ATM_LS_BARRIER_()
Definition: atm_gcc_sync.h:38
#define gpr_atm_full_xchg(p, n)
Definition: atm_gcc_atomic.h:84
#define gpr_atm_rel_cas(p, o, n)
Definition: atm_gcc_sync.h:74
intptr_t gpr_atm
Definition: atm_gcc_sync.h:26
#define gpr_atm_acq_load(p)
Definition: atm_gcc_atomic.h:50
#define gpr_atm_rel_store(p, value)
Definition: atm_gcc_atomic.h:52
intptr_t gpr_atm
Definition: atm_gcc_atomic.h:30