Back to home page

OSCL-LXR

 
 

    


0001 cat << EOF
0002 /**
0003  * arch_${atomic}_add_unless - add unless the number is already a given value
0004  * @v: pointer of type ${atomic}_t
0005  * @a: the amount to add to v...
0006  * @u: ...unless v is equal to u.
0007  *
0008  * Atomically adds @a to @v, if @v was not already @u.
0009  * Returns true if the addition was done.
0010  */
0011 static __always_inline bool
0012 arch_${atomic}_add_unless(${atomic}_t *v, ${int} a, ${int} u)
0013 {
0014         return arch_${atomic}_fetch_add_unless(v, a, u) != u;
0015 }
0016 EOF