Skip to content
Snippets Groups Projects
Commit 2c3d835d authored by Craig Tiller's avatar Craig Tiller
Browse files

Implement gpr_atm_full_cas for Windows

parent 3569a76d
No related branches found
No related tags found
No related merge requests found
...@@ -95,6 +95,16 @@ static __inline int gpr_atm_rel_cas(gpr_atm *p, gpr_atm o, gpr_atm n) { ...@@ -95,6 +95,16 @@ static __inline int gpr_atm_rel_cas(gpr_atm *p, gpr_atm o, gpr_atm n) {
#endif #endif
} }
static __inline int gpr_atm_full_cas(gpr_atm *p, gpr_atm o, gpr_atm n) {
#ifdef GPR_ARCH_64
return o == (gpr_atm)InterlockedCompareExchange64((volatile LONGLONG *)p,
(LONGLONG)n, (LONGLONG)o);
#else
return o == (gpr_atm)InterlockedCompareExchange((volatile LONG *)p, (LONG)n,
(LONG)o);
#endif
}
static __inline gpr_atm gpr_atm_no_barrier_fetch_add(gpr_atm *p, static __inline gpr_atm gpr_atm_no_barrier_fetch_add(gpr_atm *p,
gpr_atm delta) { gpr_atm delta) {
/* Use the CAS operation to get pointer-sized fetch and add */ /* Use the CAS operation to get pointer-sized fetch and add */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment