changeset 418:ff7cf32e6950

Mistake in JMMSample_04_PartialOrder.LockGuard test
author shade
date Sun, 02 Sep 2018 11:10:43 +0200
parents 64f2cf32fa0a
children ea0195854007
files jcstress-samples/src/main/java/org/openjdk/jcstress/samples/JMMSample_04_PartialOrder.java
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/jcstress-samples/src/main/java/org/openjdk/jcstress/samples/JMMSample_04_PartialOrder.java	Fri Jan 26 18:57:29 2018 +0100
+++ b/jcstress-samples/src/main/java/org/openjdk/jcstress/samples/JMMSample_04_PartialOrder.java	Sun Sep 02 11:10:43 2018 +0200
@@ -175,13 +175,14 @@
     /*
       ----------------------------------------------------------------------------------------------------------
 
-        Of course, the same thing is achievable with locks.
+        Of course, the same thing is achievable with locks, except that (0, 1) is forbidden due to atomicity
+        of the entire locked section.
 
               [OK] org.openjdk.jcstress.samples.JMMSample_04_PartialOrder.LockGuard
             (JVM args: [-server])
           Observed state   Occurrences   Expectation  Interpretation
                     0, 0    29,017,795    ACCEPTABLE  Doing both reads early.
-                    0, 1             0    ACCEPTABLE  Caught in the middle: $x is visible, $y is not.
+                    0, 1             0     FORBIDDEN  Caught in the middle: $x is visible, $y is not.
                     1, 0             0     FORBIDDEN  Seeing $y, but not $x!
                     1, 1    31,223,995    ACCEPTABLE  Doing both reads late.
 
@@ -189,7 +190,7 @@
     @JCStressTest
     @Outcome(id = "0, 0", expect = ACCEPTABLE, desc = "Doing both reads early.")
     @Outcome(id = "1, 1", expect = ACCEPTABLE, desc = "Doing both reads late.")
-    @Outcome(id = "0, 1", expect = ACCEPTABLE, desc = "Caught in the middle: $x is visible, $y is not.")
+    @Outcome(id = "0, 1", expect = FORBIDDEN, desc = "Caught in the middle: $x is visible, $y is not.")
     @Outcome(id = "1, 0", expect = FORBIDDEN, desc = "Seeing $y, but not $x!")
     @State
     public static class LockGuard {