11c27b644SPaul E. McKenneyC Z6.0+pooncelock+pooncelock+pombonce
21c27b644SPaul E. McKenney
31c27b644SPaul E. McKenney{}
41c27b644SPaul E. McKenney
51c27b644SPaul E. McKenneyP0(int *x, int *y, spinlock_t *mylock)
61c27b644SPaul E. McKenney{
71c27b644SPaul E. McKenney	spin_lock(mylock);
81c27b644SPaul E. McKenney	WRITE_ONCE(*x, 1);
91c27b644SPaul E. McKenney	WRITE_ONCE(*y, 1);
101c27b644SPaul E. McKenney	spin_unlock(mylock);
111c27b644SPaul E. McKenney}
121c27b644SPaul E. McKenney
131c27b644SPaul E. McKenneyP1(int *y, int *z, spinlock_t *mylock)
141c27b644SPaul E. McKenney{
151c27b644SPaul E. McKenney	int r0;
161c27b644SPaul E. McKenney
171c27b644SPaul E. McKenney	spin_lock(mylock);
181c27b644SPaul E. McKenney	r0 = READ_ONCE(*y);
191c27b644SPaul E. McKenney	WRITE_ONCE(*z, 1);
201c27b644SPaul E. McKenney	spin_unlock(mylock);
211c27b644SPaul E. McKenney}
221c27b644SPaul E. McKenney
231c27b644SPaul E. McKenneyP2(int *x, int *z)
241c27b644SPaul E. McKenney{
251c27b644SPaul E. McKenney	int r1;
261c27b644SPaul E. McKenney
271c27b644SPaul E. McKenney	WRITE_ONCE(*z, 2);
281c27b644SPaul E. McKenney	smp_mb();
291c27b644SPaul E. McKenney	r1 = READ_ONCE(*x);
301c27b644SPaul E. McKenney}
311c27b644SPaul E. McKenney
321c27b644SPaul E. McKenneyexists (1:r0=1 /\ z=2 /\ 2:r1=0)
33