Commit | Line | Data |
---|---|---|
ace9bad4 MR |
1 | cat << EOF |
2 | /** | |
f3e615b4 | 3 | * arch_${atomic}_add_unless - add unless the number is already a given value |
ace9bad4 MR |
4 | * @v: pointer of type ${atomic}_t |
5 | * @a: the amount to add to v... | |
6 | * @u: ...unless v is equal to u. | |
7 | * | |
8 | * Atomically adds @a to @v, if @v was not already @u. | |
9 | * Returns true if the addition was done. | |
10 | */ | |
765dcd20 | 11 | static __always_inline bool |
f3e615b4 | 12 | arch_${atomic}_add_unless(${atomic}_t *v, ${int} a, ${int} u) |
ace9bad4 | 13 | { |
f3e615b4 | 14 | return arch_${atomic}_fetch_add_unless(v, a, u) != u; |
ace9bad4 MR |
15 | } |
16 | EOF |