11 static int r1, r2, r3;
13 static void a(void *obj)
15 atomic_store_explicit(&z, 1, memory_order_relaxed);
18 static void b(void *obj)
20 atomic_store_explicit(&x, 1, memory_order_relaxed);
21 atomic_store_explicit(&y, 1, memory_order_relaxed);
22 r1=atomic_load_explicit(&z, memory_order_relaxed);
24 static void c(void *obj)
26 atomic_store_explicit(&z, 2, memory_order_relaxed);
27 atomic_store_explicit(&x, 2, memory_order_relaxed);
28 r2=atomic_load_explicit(&y, memory_order_relaxed);
31 static void d(void *obj)
33 atomic_store_explicit(&z, 3, memory_order_relaxed);
34 atomic_store_explicit(&y, 2, memory_order_relaxed);
35 r3=atomic_load_explicit(&x, memory_order_relaxed);
38 int user_main(int argc, char **argv)
46 thrd_create(&t1, (thrd_start_t)&a, NULL);
47 thrd_create(&t2, (thrd_start_t)&b, NULL);
48 thrd_create(&t3, (thrd_start_t)&c, NULL);
49 thrd_create(&t4, (thrd_start_t)&d, NULL);
56 /* Check and/or print r1, r2, r3? */