linux-zen-desktop/scripts/atomic/fallbacks/try_cmpxchg

8 lines
141 B
Plaintext
Raw Normal View History

2023-08-30 17:31:07 +02:00
cat <<EOF
${int} r, o = *old;
2023-10-24 12:59:35 +02:00
r = raw_${atomic}_cmpxchg${order}(v, o, new);
2023-08-30 17:31:07 +02:00
if (unlikely(r != o))
*old = r;
return likely(r == o);
EOF