11 static void a(void *obj)
13 int r1=atomic_load_explicit(&y, memory_order_relaxed);
14 atomic_store_explicit(&x, r1, memory_order_relaxed);
19 static void b(void *obj)
21 int r2=atomic_load_explicit(&x, memory_order_relaxed);
22 atomic_store_explicit(&y, 42, memory_order_relaxed);
27 int main(int argc, char **argv)
34 printf("Main thread: creating 2 threads\n");
35 thrd_create(&t1, (thrd_start_t)&a, NULL);
36 thrd_create(&t2, (thrd_start_t)&b, NULL);
40 printf("Main thread is finished\n");