10 static void r(void *obj)
12 int r1=atomic_load_explicit(&a, memory_order_relaxed);
13 int r2=atomic_load_explicit(&a, memory_order_relaxed);
15 atomic_store_explicit(&b, 2, memory_order_relaxed);
20 static void s(void *obj)
22 int r3=atomic_load_explicit(&b, memory_order_relaxed);
23 atomic_store_explicit(&a, r3, memory_order_relaxed);
27 int user_main(int argc, char **argv)
34 printf("Main thread: creating 2 threads\n");
35 thrd_create(&t1, (thrd_start_t)&r, NULL);
36 thrd_create(&t2, (thrd_start_t)&s, NULL);
40 printf("Main thread is finished\n");