Back to home page

OSCL-LXR

 
 

    


0001 C S+poonceonces
0002 
0003 (*
0004  * Result: Sometimes
0005  *
0006  * Starting with a two-process release-acquire chain ordering P0()'s
0007  * first store against P1()'s final load, if the smp_store_release()
0008  * is replaced by WRITE_ONCE() and the smp_load_acquire() replaced by
0009  * READ_ONCE(), is ordering preserved?
0010  *)
0011 
0012 {}
0013 
0014 P0(int *x, int *y)
0015 {
0016         WRITE_ONCE(*x, 2);
0017         WRITE_ONCE(*y, 1);
0018 }
0019 
0020 P1(int *x, int *y)
0021 {
0022         int r0;
0023 
0024         r0 = READ_ONCE(*y);
0025         WRITE_ONCE(*x, 1);
0026 }
0027 
0028 exists (x=2 /\ 1:r0=1)