try_cmpxchg (4b4193256c8d3bc3a5397b5cd9494c2ad386317d) | try_cmpxchg (f3e615b4db1fb7034f1d76dc307b77cc848f040e) |
---|---|
1cat <<EOF 2static __always_inline bool | 1cat <<EOF 2static __always_inline bool |
3${arch}${atomic}_try_cmpxchg${order}(${atomic}_t *v, ${int} *old, ${int} new) | 3arch_${atomic}_try_cmpxchg${order}(${atomic}_t *v, ${int} *old, ${int} new) |
4{ 5 ${int} r, o = *old; | 4{ 5 ${int} r, o = *old; |
6 r = ${arch}${atomic}_cmpxchg${order}(v, o, new); | 6 r = arch_${atomic}_cmpxchg${order}(v, o, new); |
7 if (unlikely(r != o)) 8 *old = r; 9 return likely(r == o); 10} 11EOF | 7 if (unlikely(r != o)) 8 *old = r; 9 return likely(r == o); 10} 11EOF |