ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/AtomicBoolean9Test.java
(Generate patch)

Comparing jsr166/src/test/tck/AtomicBoolean9Test.java (file contents):
Revision 1.1 by jsr166, Fri Jun 17 19:00:48 2016 UTC vs.
Revision 1.2 by jsr166, Tue Oct 11 20:38:07 2016 UTC

# Line 135 | Line 135 | public class AtomicBoolean9Test extends
135      }
136  
137      /**
138 +     * repeated weakCompareAndSetPlain succeeds in changing value when equal
139 +     * to expected
140 +     */
141 +    public void testWeakCompareAndSetPlain() {
142 +        AtomicBoolean ai = new AtomicBoolean(true);
143 +        do {} while (!ai.weakCompareAndSetPlain(true, false));
144 +        do {} while (!ai.weakCompareAndSetPlain(false, false));
145 +        assertFalse(ai.get());
146 +        do {} while (!ai.weakCompareAndSetPlain(false, true));
147 +        assertTrue(ai.get());
148 +    }
149 +
150 +    /**
151       * repeated weakCompareAndSetVolatile succeeds in changing value when equal
152       * to expected
153       */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines