1 C MP+fencewmbonceonce+fencermbonceonce
6 * This litmus test demonstrates that smp_wmb() and smp_rmb() provide
7 * sufficient ordering for the message-passing pattern. However, it
8 * is usually better to use smp_store_release() and smp_load_acquire().
13 P0(int *buf, int *flag) // Producer
20 P1(int *buf, int *flag) // Consumer
25 r0 = READ_ONCE(*flag);
30 exists (1:r0=1 /\ 1:r1=0) (* Bad outcome. *)