* src/atomic_ops/sysdeps/gcc/powerpc.h (AO_compare_and_swap_full,
AO_fetch_compare_and_swap_full): Do not call AO_lwsync 2nd time if
CAS is not successful.
int result;
AO_lwsync();
result = AO_compare_and_swap(addr, old, new_val);
- AO_lwsync();
+ if (result)
+ AO_lwsync();
return result;
}
# define AO_HAVE_compare_and_swap_full
AO_t result;
AO_lwsync();
result = AO_fetch_compare_and_swap(addr, old_val, new_val);
- AO_lwsync();
+ if (result == old_val)
+ AO_lwsync();
return result;
}
#define AO_HAVE_fetch_compare_and_swap_full