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
29 #define GPR_ATM_MAX INTPTR_MAX
30 #define GPR_ATM_MIN INTPTR_MIN
31 #define GPR_ATM_INC_CAS_THEN(blah) blah
32 #define GPR_ATM_INC_ADD_THEN(blah) blah
34 #define GPR_ATM_COMPILE_BARRIER_() __asm__ __volatile__("" : : : "memory")
36 #if defined(__i386) || defined(__x86_64__)
38 #define GPR_ATM_LS_BARRIER_() GPR_ATM_COMPILE_BARRIER_()
40 #define GPR_ATM_LS_BARRIER_() gpr_atm_full_barrier()
43 #define gpr_atm_full_barrier() (__sync_synchronize())
67 #undef GPR_ATM_LS_BARRIER_
68 #undef GPR_ATM_COMPILE_BARRIER_
70 #define gpr_atm_no_barrier_fetch_add(p, delta) \
71 gpr_atm_full_fetch_add((p), (delta))
72 #define gpr_atm_full_fetch_add(p, delta) (__sync_fetch_and_add((p), (delta)))
74 #define gpr_atm_no_barrier_cas(p, o, n) gpr_atm_acq_cas((p), (o), (n))
75 #define gpr_atm_acq_cas(p, o, n) (__sync_bool_compare_and_swap((p), (o), (n)))
76 #define gpr_atm_rel_cas(p, o, n) gpr_atm_acq_cas((p), (o), (n))
77 #define gpr_atm_full_cas(p, o, n) gpr_atm_acq_cas((p), (o), (n))
static __inline gpr_atm gpr_atm_full_xchg(gpr_atm *p, gpr_atm n)
static __inline void gpr_atm_no_barrier_store(gpr_atm *p, gpr_atm value)
#define GPR_ATM_COMPILE_BARRIER_()
static __inline gpr_atm gpr_atm_no_barrier_load(const gpr_atm *p)
#define GPR_ATM_LS_BARRIER_()
static __inline gpr_atm gpr_atm_acq_load(const gpr_atm *p)
#define gpr_atm_rel_cas(p, o, n)
static __inline void gpr_atm_rel_store(gpr_atm *p, gpr_atm value)
grpc
Author(s):
autogenerated on Thu Mar 13 2025 02:58:35