10 static void a(void *obj)
12 int v1=atomic_fetch_add_explicit(&x, 1, memory_order_relaxed);
13 int v2=atomic_fetch_add_explicit(&y, 1, memory_order_relaxed);
14 printf("v1 = %d, v2=%d\n", v1, v2);
17 static void b(void *obj)
19 int v3=atomic_fetch_add_explicit(&y, 1, memory_order_relaxed);
20 int v4=atomic_fetch_add_explicit(&x, 1, memory_order_relaxed);
21 printf("v3 = %d, v4=%d\n", v3, v4);
24 int user_main(int argc, char **argv)
30 thrd_create(&t1, (thrd_start_t)&a, NULL);
31 thrd_create(&t2, (thrd_start_t)&b, NULL);