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

Diff of /jsr166/src/test/tck/AtomicInteger9Test.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            AtomicInteger ai = new AtomicInteger(1);
143            do {} while (!ai.weakCompareAndSetPlain(1, 2));
144            do {} while (!ai.weakCompareAndSetPlain(2, -4));
145            assertEquals(-4, ai.get());
146            do {} while (!ai.weakCompareAndSetPlain(-4, 7));
147            assertEquals(7, 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