WSL2-Linux-Kernel/scripts/atomic/fallbacks/try_cmpxchg

12 строки
254 B
Plaintext
Executable File

cat <<EOF
static __always_inline bool
${arch}${atomic}_try_cmpxchg${order}(${atomic}_t *v, ${int} *old, ${int} new)
{
${int} r, o = *old;
r = ${arch}${atomic}_cmpxchg${order}(v, o, new);
if (unlikely(r != o))
*old = r;
return likely(r == o);
}
EOF