diff options
author | Craig Tiller <ctiller@google.com> | 2017-03-31 06:40:30 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2017-03-31 06:40:30 -0700 |
commit | a51a6c22d4bd3d1a56623443d0157caba301cc46 (patch) | |
tree | ff3af70bf0eeb04861e7507c8a1c94c87723f010 /include/grpc/impl/codegen/atm_gcc_atomic.h | |
parent | 97d401128bf00254ab626b86dfebef4289e6369c (diff) | |
parent | 55fd6638be772215aa525d7999bd47e7b483d951 (diff) |
Merge github.com:grpc/grpc into atomic-timers
Diffstat (limited to 'include/grpc/impl/codegen/atm_gcc_atomic.h')
-rw-r--r-- | include/grpc/impl/codegen/atm_gcc_atomic.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/grpc/impl/codegen/atm_gcc_atomic.h b/include/grpc/impl/codegen/atm_gcc_atomic.h index c8832419df..d52975ce97 100644 --- a/include/grpc/impl/codegen/atm_gcc_atomic.h +++ b/include/grpc/impl/codegen/atm_gcc_atomic.h @@ -86,6 +86,11 @@ static __inline int gpr_atm_rel_cas(gpr_atm *p, gpr_atm o, gpr_atm n) { p, &o, n, 0, __ATOMIC_RELEASE, __ATOMIC_RELAXED)); } +static __inline int gpr_atm_full_cas(gpr_atm *p, gpr_atm o, gpr_atm n) { + return GPR_ATM_INC_CAS_THEN(__atomic_compare_exchange_n( + p, &o, n, 0, __ATOMIC_ACQ_REL, __ATOMIC_RELAXED)); +} + #define gpr_atm_full_xchg(p, n) \ GPR_ATM_INC_CAS_THEN(__atomic_exchange_n((p), (n), __ATOMIC_ACQ_REL)) |