34 #ifndef GRPC_SUPPORT_ATM_GCC_SYNC_H
35 #define GRPC_SUPPORT_ATM_GCC_SYNC_H
43 #define GPR_ATM_COMPILE_BARRIER_() __asm__ __volatile__("" : : : "memory")
45 #if defined(__i386) || defined(__x86_64__)
47 #define GPR_ATM_LS_BARRIER_() GPR_ATM_COMPILE_BARRIER_()
49 #define GPR_ATM_LS_BARRIER_() gpr_atm_full_barrier()
52 #define gpr_atm_full_barrier() (__sync_synchronize())
76 #undef GPR_ATM_LS_BARRIER_
77 #undef GPR_ATM_COMPILE_BARRIER_
79 #define gpr_atm_no_barrier_fetch_add(p, delta) \
80 gpr_atm_full_fetch_add((p), (delta))
81 #define gpr_atm_full_fetch_add(p, delta) (__sync_fetch_and_add((p), (delta)))
83 #define gpr_atm_no_barrier_cas(p, o, n) gpr_atm_acq_cas((p), (o), (n))
84 #define gpr_atm_acq_cas(p, o, n) (__sync_bool_compare_and_swap((p), (o), (n)))
85 #define gpr_atm_rel_cas(p, o, n) gpr_atm_acq_cas((p), (o), (n))
const char * value
Definition: hpack_table.c:44
#define GPR_ATM_LS_BARRIER_()
Definition: atm_gcc_sync.h:49
#define GPR_ATM_COMPILE_BARRIER_()
Definition: atm_gcc_sync.h:43
#define gpr_atm_acq_load(p)
Definition: atm_gcc_atomic.h:45
#define gpr_atm_no_barrier_load(p)
Definition: atm_gcc_atomic.h:46
gpr_intptr gpr_atm
Definition: atm_gcc_sync.h:41
#define gpr_atm_no_barrier_store(p, value)
Definition: atm_gcc_atomic.h:49
#define gpr_atm_rel_store(p, value)
Definition: atm_gcc_atomic.h:47
gpr_intptr gpr_atm
Definition: atm_gcc_atomic.h:41