thesis/linux-6.8.1/scripts/atomic/fallbacks/fetch_add_unless
2025-03-19 13:44:23 +01:00

10 lines
156 B
Text
Executable file

cat << EOF
${int} c = raw_${atomic}_read(v);
do {
if (unlikely(c == u))
break;
} while (!raw_${atomic}_try_cmpxchg(v, &c, c + a));
return c;
EOF