4
int y = __sync_add_and_fetch(&x, 5);
5
printf("*%d,%d*\n", x, y);
7
y = __sync_fetch_and_add(&x, 5);
8
printf("*%d,%d*\n", x, y);
10
y = __sync_lock_test_and_set(&x, 6);
11
printf("*%d,%d*\n", x, y);
13
y = __sync_bool_compare_and_swap(&x, 9, 7);
14
printf("*%d,%d*\n", x, y);
15
y = __sync_bool_compare_and_swap(&x, 10, 7);
16
printf("*%d,%d*\n", x, y);