11 static void a(void *obj)
13 atomic_store_explicit(&z, 1, memory_order_relaxed);
16 static void b(void *obj)
18 atomic_store_explicit(&x, 1, memory_order_relaxed);
19 atomic_store_explicit(&y, 1, memory_order_relaxed);
20 int r1=atomic_load_explicit(&z, memory_order_relaxed);
22 static void c(void *obj)
24 atomic_store_explicit(&z, 2, memory_order_relaxed);
25 atomic_store_explicit(&x, 2, memory_order_relaxed);
26 int r2=atomic_load_explicit(&y, memory_order_relaxed);
29 static void d(void *obj)
31 atomic_store_explicit(&z, 3, memory_order_relaxed);
32 atomic_store_explicit(&y, 2, memory_order_relaxed);
33 int r3=atomic_load_explicit(&x, memory_order_relaxed);
36 int user_main(int argc, char **argv)
44 thrd_create(&t1, (thrd_start_t)&a, NULL);
45 thrd_create(&t2, (thrd_start_t)&b, NULL);
46 thrd_create(&t3, (thrd_start_t)&c, NULL);
47 thrd_create(&t4, (thrd_start_t)&d, NULL);