Home
last modified time | relevance | path

Searched refs:compareAndExchange (Results 1 – 25 of 48) sorted by relevance

12

/libcore/luni/src/test/java/libcore/java/util/concurrent/
DAtomicBooleanTest.java35 assertEquals(true, val.compareAndExchange(expected, newValue)); in testCompareAndExchange()
37 assertEquals(true, val.compareAndExchange(expected, newValue)); in testCompareAndExchange()
40 assertEquals(true, val.compareAndExchange(expected, newValue)); in testCompareAndExchange()
42 assertEquals(false, val.compareAndExchange(expected, newValue)); in testCompareAndExchange()
46 assertEquals(false, val.compareAndExchange(expected, newValue)); in testCompareAndExchange()
DAtomicLongTest.java33 assertEquals(42, val.compareAndExchange(0, 1)); in testCompareAndExchange()
35 assertEquals(42, val.compareAndExchange(42, 1)); in testCompareAndExchange()
37 assertEquals(1, val.compareAndExchange(1, -1)); in testCompareAndExchange()
39 assertEquals(-1, val.compareAndExchange(42, 0)); in testCompareAndExchange()
DAtomicIntegerTest.java33 assertEquals(42, val.compareAndExchange(0, 1)); in testCompareAndExchange()
35 assertEquals(42, val.compareAndExchange(42, 1)); in testCompareAndExchange()
37 assertEquals(1, val.compareAndExchange(1, -1)); in testCompareAndExchange()
39 assertEquals(-1, val.compareAndExchange(42, 0)); in testCompareAndExchange()
DAtomicIntegerArrayTest.java42 assertEquals(expectedArray[i], arr.compareAndExchange(i, 0, i+1)); in testCompareAndExchange()
45 assertEquals(expectedArray[i], arr.compareAndExchange(i, expectedArray[i], i+1)); in testCompareAndExchange()
50 assertEquals(i+1, arr.compareAndExchange(i, i+1, -1)); in testCompareAndExchange()
55 assertEquals(-1, arr.compareAndExchange(i, -1, i*2)); in testCompareAndExchange()
DAtomicLongArrayTest.java42 assertEquals(expectedArray[i], arr.compareAndExchange(i, 0, i+1)); in testCompareAndExchange()
45 assertEquals(expectedArray[i], arr.compareAndExchange(i, expectedArray[i], i+1)); in testCompareAndExchange()
50 assertEquals(i+1, arr.compareAndExchange(i, i+1, -1)); in testCompareAndExchange()
55 assertEquals(-1, arr.compareAndExchange(i, -1, i*2)); in testCompareAndExchange()
DAtomicReferenceTest.java38 Integer result = val.compareAndExchange(notCurrent, newValue); in testCompareAndExchange()
45 result = val.compareAndExchange(notCurrent, newValue); in testCompareAndExchange()
51 result = val.compareAndExchange(currentValue, newValue); in testCompareAndExchange()
61 result = val.compareAndExchange(notCurrent, newValue); in testCompareAndExchange()
68 result = val.compareAndExchange(currentValue, newValue); in testCompareAndExchange()
/libcore/ojluni/src/test/java/lang/invoke/VarHandles/
DVarHandleTestMethodTypeDouble.java463 double x = (double) vh.compareAndExchange(null, 1.0d, 1.0d); in testInstanceFieldWrongMethodType()
466 double x = (double) vh.compareAndExchange(Void.class, 1.0d, 1.0d); in testInstanceFieldWrongMethodType()
469 double x = (double) vh.compareAndExchange(recv, Void.class, 1.0d); in testInstanceFieldWrongMethodType()
472 double x = (double) vh.compareAndExchange(recv, 1.0d, Void.class); in testInstanceFieldWrongMethodType()
475 double x = (double) vh.compareAndExchange(0, 1.0d, 1.0d); in testInstanceFieldWrongMethodType()
479 Void r = (Void) vh.compareAndExchange(recv, 1.0d, 1.0d); in testInstanceFieldWrongMethodType()
482 boolean x = (boolean) vh.compareAndExchange(recv, 1.0d, 1.0d); in testInstanceFieldWrongMethodType()
486 double x = (double) vh.compareAndExchange(); in testInstanceFieldWrongMethodType()
489 double x = (double) vh.compareAndExchange(recv, 1.0d, 1.0d, Void.class); in testInstanceFieldWrongMethodType()
1148 double x = (double) vh.compareAndExchange(Void.class, 1.0d); in testStaticFieldWrongMethodType()
[all …]
DVarHandleTestMethodTypeFloat.java463 float x = (float) vh.compareAndExchange(null, 1.0f, 1.0f); in testInstanceFieldWrongMethodType()
466 float x = (float) vh.compareAndExchange(Void.class, 1.0f, 1.0f); in testInstanceFieldWrongMethodType()
469 float x = (float) vh.compareAndExchange(recv, Void.class, 1.0f); in testInstanceFieldWrongMethodType()
472 float x = (float) vh.compareAndExchange(recv, 1.0f, Void.class); in testInstanceFieldWrongMethodType()
475 float x = (float) vh.compareAndExchange(0, 1.0f, 1.0f); in testInstanceFieldWrongMethodType()
479 Void r = (Void) vh.compareAndExchange(recv, 1.0f, 1.0f); in testInstanceFieldWrongMethodType()
482 boolean x = (boolean) vh.compareAndExchange(recv, 1.0f, 1.0f); in testInstanceFieldWrongMethodType()
486 float x = (float) vh.compareAndExchange(); in testInstanceFieldWrongMethodType()
489 float x = (float) vh.compareAndExchange(recv, 1.0f, 1.0f, Void.class); in testInstanceFieldWrongMethodType()
1148 float x = (float) vh.compareAndExchange(Void.class, 1.0f); in testStaticFieldWrongMethodType()
[all …]
DVarHandleTestMethodTypeString.java463 String x = (String) vh.compareAndExchange(null, "foo", "foo"); in testInstanceFieldWrongMethodType()
466 String x = (String) vh.compareAndExchange(Void.class, "foo", "foo"); in testInstanceFieldWrongMethodType()
469 String x = (String) vh.compareAndExchange(recv, Void.class, "foo"); in testInstanceFieldWrongMethodType()
472 String x = (String) vh.compareAndExchange(recv, "foo", Void.class); in testInstanceFieldWrongMethodType()
475 String x = (String) vh.compareAndExchange(0, "foo", "foo"); in testInstanceFieldWrongMethodType()
479 Void r = (Void) vh.compareAndExchange(recv, "foo", "foo"); in testInstanceFieldWrongMethodType()
482 boolean x = (boolean) vh.compareAndExchange(recv, "foo", "foo"); in testInstanceFieldWrongMethodType()
486 String x = (String) vh.compareAndExchange(); in testInstanceFieldWrongMethodType()
489 String x = (String) vh.compareAndExchange(recv, "foo", "foo", Void.class); in testInstanceFieldWrongMethodType()
1026 String x = (String) vh.compareAndExchange(Void.class, "foo"); in testStaticFieldWrongMethodType()
[all …]
DVarHandleTestMethodTypeBoolean.java463 boolean x = (boolean) vh.compareAndExchange(null, true, true); in testInstanceFieldWrongMethodType()
466 boolean x = (boolean) vh.compareAndExchange(Void.class, true, true); in testInstanceFieldWrongMethodType()
469 boolean x = (boolean) vh.compareAndExchange(recv, Void.class, true); in testInstanceFieldWrongMethodType()
472 boolean x = (boolean) vh.compareAndExchange(recv, true, Void.class); in testInstanceFieldWrongMethodType()
475 boolean x = (boolean) vh.compareAndExchange(0, true, true); in testInstanceFieldWrongMethodType()
479 Void r = (Void) vh.compareAndExchange(recv, true, true); in testInstanceFieldWrongMethodType()
482 int x = (int) vh.compareAndExchange(recv, true, true); in testInstanceFieldWrongMethodType()
486 boolean x = (boolean) vh.compareAndExchange(); in testInstanceFieldWrongMethodType()
489 boolean x = (boolean) vh.compareAndExchange(recv, true, true, Void.class); in testInstanceFieldWrongMethodType()
1330 boolean x = (boolean) vh.compareAndExchange(Void.class, true); in testStaticFieldWrongMethodType()
[all …]
DVarHandleTestMethodTypeLong.java463 long x = (long) vh.compareAndExchange(null, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL); in testInstanceFieldWrongMethodType()
466 … long x = (long) vh.compareAndExchange(Void.class, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL); in testInstanceFieldWrongMethodType()
469 long x = (long) vh.compareAndExchange(recv, Void.class, 0x0123456789ABCDEFL); in testInstanceFieldWrongMethodType()
472 long x = (long) vh.compareAndExchange(recv, 0x0123456789ABCDEFL, Void.class); in testInstanceFieldWrongMethodType()
475 long x = (long) vh.compareAndExchange(0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL); in testInstanceFieldWrongMethodType()
479 Void r = (Void) vh.compareAndExchange(recv, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL); in testInstanceFieldWrongMethodType()
482 … boolean x = (boolean) vh.compareAndExchange(recv, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL); in testInstanceFieldWrongMethodType()
486 long x = (long) vh.compareAndExchange(); in testInstanceFieldWrongMethodType()
489 … long x = (long) vh.compareAndExchange(recv, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class); in testInstanceFieldWrongMethodType()
1452 long x = (long) vh.compareAndExchange(Void.class, 0x0123456789ABCDEFL); in testStaticFieldWrongMethodType()
[all …]
DVarHandleTestMethodTypeInt.java463 int x = (int) vh.compareAndExchange(null, 0x01234567, 0x01234567); in testInstanceFieldWrongMethodType()
466 int x = (int) vh.compareAndExchange(Void.class, 0x01234567, 0x01234567); in testInstanceFieldWrongMethodType()
469 int x = (int) vh.compareAndExchange(recv, Void.class, 0x01234567); in testInstanceFieldWrongMethodType()
472 int x = (int) vh.compareAndExchange(recv, 0x01234567, Void.class); in testInstanceFieldWrongMethodType()
475 int x = (int) vh.compareAndExchange(0, 0x01234567, 0x01234567); in testInstanceFieldWrongMethodType()
479 Void r = (Void) vh.compareAndExchange(recv, 0x01234567, 0x01234567); in testInstanceFieldWrongMethodType()
482 boolean x = (boolean) vh.compareAndExchange(recv, 0x01234567, 0x01234567); in testInstanceFieldWrongMethodType()
486 int x = (int) vh.compareAndExchange(); in testInstanceFieldWrongMethodType()
489 int x = (int) vh.compareAndExchange(recv, 0x01234567, 0x01234567, Void.class); in testInstanceFieldWrongMethodType()
1452 int x = (int) vh.compareAndExchange(Void.class, 0x01234567); in testStaticFieldWrongMethodType()
[all …]
DVarHandleTestMethodTypeByte.java463 byte x = (byte) vh.compareAndExchange(null, (byte)0x01, (byte)0x01); in testInstanceFieldWrongMethodType()
466 byte x = (byte) vh.compareAndExchange(Void.class, (byte)0x01, (byte)0x01); in testInstanceFieldWrongMethodType()
469 byte x = (byte) vh.compareAndExchange(recv, Void.class, (byte)0x01); in testInstanceFieldWrongMethodType()
472 byte x = (byte) vh.compareAndExchange(recv, (byte)0x01, Void.class); in testInstanceFieldWrongMethodType()
475 byte x = (byte) vh.compareAndExchange(0, (byte)0x01, (byte)0x01); in testInstanceFieldWrongMethodType()
479 Void r = (Void) vh.compareAndExchange(recv, (byte)0x01, (byte)0x01); in testInstanceFieldWrongMethodType()
482 boolean x = (boolean) vh.compareAndExchange(recv, (byte)0x01, (byte)0x01); in testInstanceFieldWrongMethodType()
486 byte x = (byte) vh.compareAndExchange(); in testInstanceFieldWrongMethodType()
489 byte x = (byte) vh.compareAndExchange(recv, (byte)0x01, (byte)0x01, Void.class); in testInstanceFieldWrongMethodType()
1452 byte x = (byte) vh.compareAndExchange(Void.class, (byte)0x01); in testStaticFieldWrongMethodType()
[all …]
DVarHandleTestMethodTypeShort.java463 short x = (short) vh.compareAndExchange(null, (short)0x0123, (short)0x0123); in testInstanceFieldWrongMethodType()
466 short x = (short) vh.compareAndExchange(Void.class, (short)0x0123, (short)0x0123); in testInstanceFieldWrongMethodType()
469 short x = (short) vh.compareAndExchange(recv, Void.class, (short)0x0123); in testInstanceFieldWrongMethodType()
472 short x = (short) vh.compareAndExchange(recv, (short)0x0123, Void.class); in testInstanceFieldWrongMethodType()
475 short x = (short) vh.compareAndExchange(0, (short)0x0123, (short)0x0123); in testInstanceFieldWrongMethodType()
479 Void r = (Void) vh.compareAndExchange(recv, (short)0x0123, (short)0x0123); in testInstanceFieldWrongMethodType()
482 boolean x = (boolean) vh.compareAndExchange(recv, (short)0x0123, (short)0x0123); in testInstanceFieldWrongMethodType()
486 short x = (short) vh.compareAndExchange(); in testInstanceFieldWrongMethodType()
489 short x = (short) vh.compareAndExchange(recv, (short)0x0123, (short)0x0123, Void.class); in testInstanceFieldWrongMethodType()
1452 short x = (short) vh.compareAndExchange(Void.class, (short)0x0123); in testStaticFieldWrongMethodType()
[all …]
DVarHandleTestMethodTypeChar.java463 char x = (char) vh.compareAndExchange(null, '\u0123', '\u0123'); in testInstanceFieldWrongMethodType()
466 char x = (char) vh.compareAndExchange(Void.class, '\u0123', '\u0123'); in testInstanceFieldWrongMethodType()
469 char x = (char) vh.compareAndExchange(recv, Void.class, '\u0123'); in testInstanceFieldWrongMethodType()
472 char x = (char) vh.compareAndExchange(recv, '\u0123', Void.class); in testInstanceFieldWrongMethodType()
475 char x = (char) vh.compareAndExchange(0, '\u0123', '\u0123'); in testInstanceFieldWrongMethodType()
479 Void r = (Void) vh.compareAndExchange(recv, '\u0123', '\u0123'); in testInstanceFieldWrongMethodType()
482 boolean x = (boolean) vh.compareAndExchange(recv, '\u0123', '\u0123'); in testInstanceFieldWrongMethodType()
486 char x = (char) vh.compareAndExchange(); in testInstanceFieldWrongMethodType()
489 char x = (char) vh.compareAndExchange(recv, '\u0123', '\u0123', Void.class); in testInstanceFieldWrongMethodType()
1452 char x = (char) vh.compareAndExchange(Void.class, '\u0123'); in testStaticFieldWrongMethodType()
[all …]
DX-VarHandleTestAccess.java.template332 $type$ r = ($type$) vh.compareAndExchange(recv, $value1$, $value2$);
476 $type$ r = ($type$) vh.compareAndExchange($value1$, $value2$);
619 $type$ r = ($type$) vh.compareAndExchange(recv, $value2$, $value1$);
620 assertEquals(r, $value2$, "success compareAndExchange $type$");
622 assertEquals(x, $value1$, "success compareAndExchange $type$ value");
626 $type$ r = ($type$) vh.compareAndExchange(recv, $value2$, $value3$);
627 assertEquals(r, $value1$, "failing compareAndExchange $type$");
629 assertEquals(x, $value1$, "failing compareAndExchange $type$ value");
853 $type$ r = ($type$) vh.compareAndExchange(recv, $value1$, $value2$);
996 $type$ r = ($type$) vh.compareAndExchange($value2$, $value1$);
[all …]
DVarHandleTestByteArrayAsFloat.java246 float r = (float) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1); in testArrayNPE()
330 float r = (float) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1); in testArrayNPE()
457 float r = (float) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1); in testArrayUnsupported()
641 float r = (float) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1); in testArrayIndexOutOfBounds()
735 float r = (float) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1); in testArrayIndexOutOfBounds()
820 float r = (float) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1); in testArrayMisalignedAccess()
907 float r = (float) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1); in testArrayMisalignedAccess()
1011 float r = (float) vh.compareAndExchange(array, i, VALUE_2, VALUE_1); in testArrayReadWrite()
1018 float r = (float) vh.compareAndExchange(array, i, VALUE_2, VALUE_3); in testArrayReadWrite()
1184 float r = (float) vh.compareAndExchange(array, i, VALUE_2, VALUE_1); in testArrayReadWrite()
[all …]
DVarHandleTestByteArrayAsDouble.java246 double r = (double) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1); in testArrayNPE()
330 double r = (double) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1); in testArrayNPE()
457 double r = (double) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1); in testArrayUnsupported()
641 double r = (double) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1); in testArrayIndexOutOfBounds()
735 double r = (double) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1); in testArrayIndexOutOfBounds()
820 double r = (double) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1); in testArrayMisalignedAccess()
907 double r = (double) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1); in testArrayMisalignedAccess()
1011 double r = (double) vh.compareAndExchange(array, i, VALUE_2, VALUE_1); in testArrayReadWrite()
1018 double r = (double) vh.compareAndExchange(array, i, VALUE_2, VALUE_3); in testArrayReadWrite()
1184 double r = (double) vh.compareAndExchange(array, i, VALUE_2, VALUE_1); in testArrayReadWrite()
[all …]
DX-VarHandleTestByteArrayView.java.template279 $type$ r = ($type$) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
415 $type$ r = ($type$) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
519 $type$ r = ($type$) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
643 $type$ r = ($type$) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
688 $type$ r = ($type$) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
835 $type$ r = ($type$) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
974 $type$ r = ($type$) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
1120 $type$ r = ($type$) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
1257 $type$ r = ($type$) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
1396 $type$ r = ($type$) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
[all …]
/libcore/ojluni/src/main/java/java/util/concurrent/atomic/
DAtomicBoolean.java267 public final boolean compareAndExchange(boolean expectedValue, boolean newValue) { in compareAndExchange() method in AtomicBoolean
268 return (int)VALUE.compareAndExchange(this, in compareAndExchange()
DAtomicLong.java532 public final long compareAndExchange(long expectedValue, long newValue) { in compareAndExchange() method in AtomicLong
535 return (long)VALUE.compareAndExchange(this, expectedValue, newValue); in compareAndExchange()
DAtomicInteger.java517 public final int compareAndExchange(int expectedValue, int newValue) { in compareAndExchange() method in AtomicInteger
520 return (int)VALUE.compareAndExchange(this, expectedValue, newValue); in compareAndExchange()
DAtomicReference.java360 public final V compareAndExchange(V expectedValue, V newValue) { in compareAndExchange() method in AtomicReference
361 return (V)VALUE.compareAndExchange(this, expectedValue, newValue); in compareAndExchange()
DAtomicLongArray.java477 public final long compareAndExchange(int i, long expectedValue, long newValue) { in compareAndExchange() method in AtomicLongArray
478 return (long)AA.compareAndExchange(array, i, expectedValue, newValue); in compareAndExchange()
DAtomicIntegerArray.java477 public final int compareAndExchange(int i, int expectedValue, int newValue) { in compareAndExchange() method in AtomicIntegerArray
478 return (int)AA.compareAndExchange(array, i, expectedValue, newValue); in compareAndExchange()

12