Back to home page

OSCL-LXR

 
 

    


0001 cat <<EOF
0002 static __always_inline bool
0003 arch_${atomic}_inc_unless_negative(${atomic}_t *v)
0004 {
0005         ${int} c = arch_${atomic}_read(v);
0006 
0007         do {
0008                 if (unlikely(c < 0))
0009                         return false;
0010         } while (!arch_${atomic}_try_cmpxchg(v, &c, c + 1));
0011 
0012         return true;
0013 }
0014 EOF