Paul E. McKenney | 1c27b64 | 2018-01-18 19:58:55 -0800 | [diff] [blame] | 1 | C MP+pooncerelease+poacquireonce |
| 2 | |
Paul E. McKenney | 8f32543 | 2018-02-20 15:25:04 -0800 | [diff] [blame] | 3 | (* |
| 4 | * Result: Never |
| 5 | * |
| 6 | * This litmus test demonstrates that smp_store_release() and |
| 7 | * smp_load_acquire() provide sufficient ordering for the message-passing |
| 8 | * pattern. |
| 9 | *) |
| 10 | |
Paul E. McKenney | 1c27b64 | 2018-01-18 19:58:55 -0800 | [diff] [blame] | 11 | {} |
| 12 | |
| 13 | P0(int *x, int *y) |
| 14 | { |
| 15 | WRITE_ONCE(*x, 1); |
| 16 | smp_store_release(y, 1); |
| 17 | } |
| 18 | |
| 19 | P1(int *x, int *y) |
| 20 | { |
| 21 | int r0; |
| 22 | int r1; |
| 23 | |
| 24 | r0 = smp_load_acquire(y); |
| 25 | r1 = READ_ONCE(*x); |
| 26 | } |
| 27 | |
| 28 | exists (1:r0=1 /\ 1:r1=0) |