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

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

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

revision 1.22, Wed Dec 31 19:05:42 2014 UTC revision 1.23, Wed Dec 31 19:21:20 2014 UTC
# Line 97  Line 97 
97       */       */
98      public void testWeakCompareAndSet() {      public void testWeakCompareAndSet() {
99          AtomicBoolean ai = new AtomicBoolean(true);          AtomicBoolean ai = new AtomicBoolean(true);
100          while (!ai.weakCompareAndSet(true, false));          do {} while (!ai.weakCompareAndSet(true, false));
101          assertFalse(ai.get());          assertFalse(ai.get());
102          while (!ai.weakCompareAndSet(false, false));          do {} while (!ai.weakCompareAndSet(false, false));
103          assertFalse(ai.get());          assertFalse(ai.get());
104          while (!ai.weakCompareAndSet(false, true));          do {} while (!ai.weakCompareAndSet(false, true));
105          assertTrue(ai.get());          assertTrue(ai.get());
106      }      }
107    

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.23

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8