☰
Debian Codegraph
@
7.2.8-1
7.2.7-1
7.2.6-1
7.1.9-1
7.1.4-1
7.0.9-1
7.0.12-2
/
/
scripts
/
atomic
/
fallbacks
/
dec_if_positive
☽
☼
scripts/atomic/fallbacks/dec_if_positive
code
plain
raw
GPL-2
1991-2012 Linus Torvalds and many others
debian/copyright
1
cat <<EOF
2
${int} dec, c = raw_${atomic}_read(v);
3
4
do {
5
dec = c - 1;
6
if (unlikely(dec < 0))
7
break;
8
} while (!raw_${atomic}_try_cmpxchg(v, &c, dec));
9
10
return dec;
11
EOF