#include<stdio.h> //#include<ext/atomicity.h> int subInt(int i){ int n = i-1; int m = i; do{ printf(" i is:%d\n",i); m= __sync_sub_and_fetch(&i,1); }while( m !=n); return i; } int decInt(int i ) { int n = i+1; int m = i; do{ printf(" i is:%d\n",i); m= __sync_add_and_fetch(&i,1); }while( m !=n); return i; } int main() { int a =9; a=decInt(a); a=subInt(a); printf(" a is:%d\n",a); }