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

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

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

revision 1.2, Wed Aug 24 22:22:39 2016 UTC revision 1.3, Tue Oct 11 20:38:07 2016 UTC
# Line 34  Line 34 
34                  () -> aa.compareAndExchange(j, null, null),                  () -> aa.compareAndExchange(j, null, null),
35                  () -> aa.compareAndExchangeAcquire(j, null, null),                  () -> aa.compareAndExchangeAcquire(j, null, null),
36                  () -> aa.compareAndExchangeRelease(j, null, null),                  () -> aa.compareAndExchangeRelease(j, null, null),
37                    () -> aa.weakCompareAndSetPlain(j, null, null),
38                  () -> aa.weakCompareAndSetVolatile(j, null, null),                  () -> aa.weakCompareAndSetVolatile(j, null, null),
39                  () -> aa.weakCompareAndSetAcquire(j, null, null),                  () -> aa.weakCompareAndSetAcquire(j, null, null),
40                  () -> aa.weakCompareAndSetRelease(j, null, null),                  () -> aa.weakCompareAndSetRelease(j, null, null),
# Line 188  Line 189 
189      }      }
190    
191      /**      /**
192         * repeated weakCompareAndSetPlain succeeds in changing value when equal
193         * to expected
194         */
195        public void testWeakCompareAndSetPlain() {
196            AtomicReferenceArray<Integer> aa = new AtomicReferenceArray<>(SIZE);
197            for (int i = 0; i < SIZE; i++) {
198                aa.set(i, one);
199                do {} while (!aa.weakCompareAndSetPlain(i, one, two));
200                do {} while (!aa.weakCompareAndSetPlain(i, two, m4));
201                assertEquals(m4, aa.get(i));
202                do {} while (!aa.weakCompareAndSetPlain(i, m4, seven));
203                assertEquals(seven, aa.get(i));
204            }
205        }
206    
207        /**
208       * repeated weakCompareAndSetVolatile succeeds in changing value when equal       * repeated weakCompareAndSetVolatile succeeds in changing value when equal
209       * to expected       * to expected
210       */       */

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

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8