[cvs] / jsr166 / src / test / tck / AtomicBoolean9Test.java Repository:
ViewVC logotype

Diff of /jsr166/src/test/tck/AtomicBoolean9Test.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1, Fri Jun 17 19:00:48 2016 UTC revision 1.2, Tue Oct 11 20:38:07 2016 UTC
# Line 135  Line 135 
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       * repeated weakCompareAndSetVolatile succeeds in changing value when equal
152       * to expected       * to expected
153       */       */

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8