2 extern void abort (void);
3 extern void exit (int);
7 #ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4
11 if (!__sync_bool_compare_and_swap (&v, 0, 30000))
13 if (30000 != __sync_val_compare_and_swap (&v, 30000, 100001))
15 __sync_sub_and_fetch (&v, 0x8001);
16 __sync_sub_and_fetch (&v, 0x7fff);
19 if (__sync_nand_and_fetch (&v, 0xff) != 94)
21 if (__sync_fetch_and_add (&v, 6) != 94)
25 if (__sync_or_and_fetch (&v, 0xf001) != 0xf065)
27 if (__sync_and_and_fetch (&v, 0x1000) != 0x1000)
29 if (__sync_xor_and_fetch (&v, 0xa51040) != 0xa50040)
31 __sync_and_and_fetch (&v, 7);
32 if (__sync_lock_test_and_set(&v, 1) != 0)
36 __sync_lock_release (&v);