WRC+poonceonces+Once.litmus 465 B

1234567891011121314151617181920212223242526272829303132333435
  1. C WRC+poonceonces+Once
  2. (*
  3. * Result: Sometimes
  4. *
  5. * This litmus test is an extension of the message-passing pattern,
  6. * where the first write is moved to a separate process. Note that this
  7. * test has no ordering at all.
  8. *)
  9. {}
  10. P0(int *x)
  11. {
  12. WRITE_ONCE(*x, 1);
  13. }
  14. P1(int *x, int *y)
  15. {
  16. int r0;
  17. r0 = READ_ONCE(*x);
  18. WRITE_ONCE(*y, 1);
  19. }
  20. P2(int *x, int *y)
  21. {
  22. int r0;
  23. int r1;
  24. r0 = READ_ONCE(*y);
  25. r1 = READ_ONCE(*x);
  26. }
  27. exists (1:r0=1 /\ 2:r0=1 /\ 2:r1=0)