10 static void a(void *obj)
12 int r1=atomic_load_explicit(&x, memory_order_relaxed);
13 atomic_store_explicit(&y, r1, memory_order_relaxed);
17 static void b(void *obj)
19 int r2=atomic_load_explicit(&y, memory_order_relaxed);
20 atomic_store_explicit(&x, r2, memory_order_relaxed);
21 atomic_store_explicit(&x, r2 + 1, memory_order_relaxed);
25 int user_main(int argc, char **argv)
32 printf("Main thread: creating 2 threads\n");
33 thrd_create(&t1, (thrd_start_t)&a, NULL);
34 thrd_create(&t2, (thrd_start_t)&b, NULL);
38 printf("Main thread is finished\n");