8292407: Improve Weak CAS VarHandle/Unsafe tests resilience under spurious failures
Reviewed-by: yadongwang, fyang, vkempik, psandoz
This commit is contained in:
parent
17283cfe4c
commit
6e6202c14d
@ -43,7 +43,14 @@ import static org.testng.Assert.*;
|
||||
|
||||
public class JdkInternalMiscUnsafeAccessTestBoolean {
|
||||
static final int ITERS = Integer.getInteger("iters", 1);
|
||||
static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 10);
|
||||
|
||||
// More resilience for Weak* tests. These operations may spuriously
|
||||
// fail, and so we do several attempts with delay on failure.
|
||||
// Be mindful of worst-case total time on test, which would be at
|
||||
// roughly (delay*attempts) milliseconds.
|
||||
//
|
||||
static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 100);
|
||||
static final int WEAK_DELAY_MS = Math.max(1, Integer.getInteger("weakDelay", 1));
|
||||
|
||||
static final jdk.internal.misc.Unsafe UNSAFE;
|
||||
|
||||
@ -86,6 +93,16 @@ public class JdkInternalMiscUnsafeAccessTestBoolean {
|
||||
ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale);
|
||||
}
|
||||
|
||||
static void weakDelay() {
|
||||
try {
|
||||
if (WEAK_DELAY_MS > 0) {
|
||||
Thread.sleep(WEAK_DELAY_MS);
|
||||
}
|
||||
} catch (InterruptedException ie) {
|
||||
// Do nothing.
|
||||
}
|
||||
}
|
||||
|
||||
static boolean static_v;
|
||||
|
||||
boolean v;
|
||||
@ -211,6 +228,7 @@ public class JdkInternalMiscUnsafeAccessTestBoolean {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = UNSAFE.weakCompareAndSetBooleanPlain(base, offset, true, false);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain boolean");
|
||||
boolean x = UNSAFE.getBoolean(base, offset);
|
||||
@ -228,6 +246,7 @@ public class JdkInternalMiscUnsafeAccessTestBoolean {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = UNSAFE.weakCompareAndSetBooleanAcquire(base, offset, false, true);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire boolean");
|
||||
boolean x = UNSAFE.getBoolean(base, offset);
|
||||
@ -245,6 +264,7 @@ public class JdkInternalMiscUnsafeAccessTestBoolean {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = UNSAFE.weakCompareAndSetBooleanRelease(base, offset, true, false);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease boolean");
|
||||
boolean x = UNSAFE.getBoolean(base, offset);
|
||||
@ -262,6 +282,7 @@ public class JdkInternalMiscUnsafeAccessTestBoolean {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = UNSAFE.weakCompareAndSetBoolean(base, offset, false, true);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet boolean");
|
||||
boolean x = UNSAFE.getBoolean(base, offset);
|
||||
|
@ -43,7 +43,14 @@ import static org.testng.Assert.*;
|
||||
|
||||
public class JdkInternalMiscUnsafeAccessTestByte {
|
||||
static final int ITERS = Integer.getInteger("iters", 1);
|
||||
static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 10);
|
||||
|
||||
// More resilience for Weak* tests. These operations may spuriously
|
||||
// fail, and so we do several attempts with delay on failure.
|
||||
// Be mindful of worst-case total time on test, which would be at
|
||||
// roughly (delay*attempts) milliseconds.
|
||||
//
|
||||
static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 100);
|
||||
static final int WEAK_DELAY_MS = Math.max(1, Integer.getInteger("weakDelay", 1));
|
||||
|
||||
static final jdk.internal.misc.Unsafe UNSAFE;
|
||||
|
||||
@ -86,6 +93,16 @@ public class JdkInternalMiscUnsafeAccessTestByte {
|
||||
ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale);
|
||||
}
|
||||
|
||||
static void weakDelay() {
|
||||
try {
|
||||
if (WEAK_DELAY_MS > 0) {
|
||||
Thread.sleep(WEAK_DELAY_MS);
|
||||
}
|
||||
} catch (InterruptedException ie) {
|
||||
// Do nothing.
|
||||
}
|
||||
}
|
||||
|
||||
static byte static_v;
|
||||
|
||||
byte v;
|
||||
@ -240,6 +257,7 @@ public class JdkInternalMiscUnsafeAccessTestByte {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = UNSAFE.weakCompareAndSetBytePlain(base, offset, (byte)0x01, (byte)0x23);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain byte");
|
||||
byte x = UNSAFE.getByte(base, offset);
|
||||
@ -257,6 +275,7 @@ public class JdkInternalMiscUnsafeAccessTestByte {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = UNSAFE.weakCompareAndSetByteAcquire(base, offset, (byte)0x23, (byte)0x01);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire byte");
|
||||
byte x = UNSAFE.getByte(base, offset);
|
||||
@ -274,6 +293,7 @@ public class JdkInternalMiscUnsafeAccessTestByte {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = UNSAFE.weakCompareAndSetByteRelease(base, offset, (byte)0x01, (byte)0x23);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease byte");
|
||||
byte x = UNSAFE.getByte(base, offset);
|
||||
@ -291,6 +311,7 @@ public class JdkInternalMiscUnsafeAccessTestByte {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = UNSAFE.weakCompareAndSetByte(base, offset, (byte)0x23, (byte)0x01);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet byte");
|
||||
byte x = UNSAFE.getByte(base, offset);
|
||||
|
@ -43,7 +43,14 @@ import static org.testng.Assert.*;
|
||||
|
||||
public class JdkInternalMiscUnsafeAccessTestChar {
|
||||
static final int ITERS = Integer.getInteger("iters", 1);
|
||||
static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 10);
|
||||
|
||||
// More resilience for Weak* tests. These operations may spuriously
|
||||
// fail, and so we do several attempts with delay on failure.
|
||||
// Be mindful of worst-case total time on test, which would be at
|
||||
// roughly (delay*attempts) milliseconds.
|
||||
//
|
||||
static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 100);
|
||||
static final int WEAK_DELAY_MS = Math.max(1, Integer.getInteger("weakDelay", 1));
|
||||
|
||||
static final jdk.internal.misc.Unsafe UNSAFE;
|
||||
|
||||
@ -86,6 +93,16 @@ public class JdkInternalMiscUnsafeAccessTestChar {
|
||||
ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale);
|
||||
}
|
||||
|
||||
static void weakDelay() {
|
||||
try {
|
||||
if (WEAK_DELAY_MS > 0) {
|
||||
Thread.sleep(WEAK_DELAY_MS);
|
||||
}
|
||||
} catch (InterruptedException ie) {
|
||||
// Do nothing.
|
||||
}
|
||||
}
|
||||
|
||||
static char static_v;
|
||||
|
||||
char v;
|
||||
@ -258,6 +275,7 @@ public class JdkInternalMiscUnsafeAccessTestChar {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = UNSAFE.weakCompareAndSetCharPlain(base, offset, '\u0123', '\u4567');
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain char");
|
||||
char x = UNSAFE.getChar(base, offset);
|
||||
@ -275,6 +293,7 @@ public class JdkInternalMiscUnsafeAccessTestChar {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = UNSAFE.weakCompareAndSetCharAcquire(base, offset, '\u4567', '\u0123');
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire char");
|
||||
char x = UNSAFE.getChar(base, offset);
|
||||
@ -292,6 +311,7 @@ public class JdkInternalMiscUnsafeAccessTestChar {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = UNSAFE.weakCompareAndSetCharRelease(base, offset, '\u0123', '\u4567');
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease char");
|
||||
char x = UNSAFE.getChar(base, offset);
|
||||
@ -309,6 +329,7 @@ public class JdkInternalMiscUnsafeAccessTestChar {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = UNSAFE.weakCompareAndSetChar(base, offset, '\u4567', '\u0123');
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet char");
|
||||
char x = UNSAFE.getChar(base, offset);
|
||||
|
@ -43,7 +43,14 @@ import static org.testng.Assert.*;
|
||||
|
||||
public class JdkInternalMiscUnsafeAccessTestDouble {
|
||||
static final int ITERS = Integer.getInteger("iters", 1);
|
||||
static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 10);
|
||||
|
||||
// More resilience for Weak* tests. These operations may spuriously
|
||||
// fail, and so we do several attempts with delay on failure.
|
||||
// Be mindful of worst-case total time on test, which would be at
|
||||
// roughly (delay*attempts) milliseconds.
|
||||
//
|
||||
static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 100);
|
||||
static final int WEAK_DELAY_MS = Math.max(1, Integer.getInteger("weakDelay", 1));
|
||||
|
||||
static final jdk.internal.misc.Unsafe UNSAFE;
|
||||
|
||||
@ -86,6 +93,16 @@ public class JdkInternalMiscUnsafeAccessTestDouble {
|
||||
ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale);
|
||||
}
|
||||
|
||||
static void weakDelay() {
|
||||
try {
|
||||
if (WEAK_DELAY_MS > 0) {
|
||||
Thread.sleep(WEAK_DELAY_MS);
|
||||
}
|
||||
} catch (InterruptedException ie) {
|
||||
// Do nothing.
|
||||
}
|
||||
}
|
||||
|
||||
static double static_v;
|
||||
|
||||
double v;
|
||||
@ -240,6 +257,7 @@ public class JdkInternalMiscUnsafeAccessTestDouble {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = UNSAFE.weakCompareAndSetDoublePlain(base, offset, 1.0d, 2.0d);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain double");
|
||||
double x = UNSAFE.getDouble(base, offset);
|
||||
@ -257,6 +275,7 @@ public class JdkInternalMiscUnsafeAccessTestDouble {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = UNSAFE.weakCompareAndSetDoubleAcquire(base, offset, 2.0d, 1.0d);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire double");
|
||||
double x = UNSAFE.getDouble(base, offset);
|
||||
@ -274,6 +293,7 @@ public class JdkInternalMiscUnsafeAccessTestDouble {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = UNSAFE.weakCompareAndSetDoubleRelease(base, offset, 1.0d, 2.0d);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease double");
|
||||
double x = UNSAFE.getDouble(base, offset);
|
||||
@ -291,6 +311,7 @@ public class JdkInternalMiscUnsafeAccessTestDouble {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = UNSAFE.weakCompareAndSetDouble(base, offset, 2.0d, 1.0d);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet double");
|
||||
double x = UNSAFE.getDouble(base, offset);
|
||||
|
@ -43,7 +43,14 @@ import static org.testng.Assert.*;
|
||||
|
||||
public class JdkInternalMiscUnsafeAccessTestFloat {
|
||||
static final int ITERS = Integer.getInteger("iters", 1);
|
||||
static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 10);
|
||||
|
||||
// More resilience for Weak* tests. These operations may spuriously
|
||||
// fail, and so we do several attempts with delay on failure.
|
||||
// Be mindful of worst-case total time on test, which would be at
|
||||
// roughly (delay*attempts) milliseconds.
|
||||
//
|
||||
static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 100);
|
||||
static final int WEAK_DELAY_MS = Math.max(1, Integer.getInteger("weakDelay", 1));
|
||||
|
||||
static final jdk.internal.misc.Unsafe UNSAFE;
|
||||
|
||||
@ -86,6 +93,16 @@ public class JdkInternalMiscUnsafeAccessTestFloat {
|
||||
ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale);
|
||||
}
|
||||
|
||||
static void weakDelay() {
|
||||
try {
|
||||
if (WEAK_DELAY_MS > 0) {
|
||||
Thread.sleep(WEAK_DELAY_MS);
|
||||
}
|
||||
} catch (InterruptedException ie) {
|
||||
// Do nothing.
|
||||
}
|
||||
}
|
||||
|
||||
static float static_v;
|
||||
|
||||
float v;
|
||||
@ -240,6 +257,7 @@ public class JdkInternalMiscUnsafeAccessTestFloat {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = UNSAFE.weakCompareAndSetFloatPlain(base, offset, 1.0f, 2.0f);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain float");
|
||||
float x = UNSAFE.getFloat(base, offset);
|
||||
@ -257,6 +275,7 @@ public class JdkInternalMiscUnsafeAccessTestFloat {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = UNSAFE.weakCompareAndSetFloatAcquire(base, offset, 2.0f, 1.0f);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire float");
|
||||
float x = UNSAFE.getFloat(base, offset);
|
||||
@ -274,6 +293,7 @@ public class JdkInternalMiscUnsafeAccessTestFloat {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = UNSAFE.weakCompareAndSetFloatRelease(base, offset, 1.0f, 2.0f);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease float");
|
||||
float x = UNSAFE.getFloat(base, offset);
|
||||
@ -291,6 +311,7 @@ public class JdkInternalMiscUnsafeAccessTestFloat {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = UNSAFE.weakCompareAndSetFloat(base, offset, 2.0f, 1.0f);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet float");
|
||||
float x = UNSAFE.getFloat(base, offset);
|
||||
|
@ -43,7 +43,14 @@ import static org.testng.Assert.*;
|
||||
|
||||
public class JdkInternalMiscUnsafeAccessTestInt {
|
||||
static final int ITERS = Integer.getInteger("iters", 1);
|
||||
static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 10);
|
||||
|
||||
// More resilience for Weak* tests. These operations may spuriously
|
||||
// fail, and so we do several attempts with delay on failure.
|
||||
// Be mindful of worst-case total time on test, which would be at
|
||||
// roughly (delay*attempts) milliseconds.
|
||||
//
|
||||
static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 100);
|
||||
static final int WEAK_DELAY_MS = Math.max(1, Integer.getInteger("weakDelay", 1));
|
||||
|
||||
static final jdk.internal.misc.Unsafe UNSAFE;
|
||||
|
||||
@ -86,6 +93,16 @@ public class JdkInternalMiscUnsafeAccessTestInt {
|
||||
ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale);
|
||||
}
|
||||
|
||||
static void weakDelay() {
|
||||
try {
|
||||
if (WEAK_DELAY_MS > 0) {
|
||||
Thread.sleep(WEAK_DELAY_MS);
|
||||
}
|
||||
} catch (InterruptedException ie) {
|
||||
// Do nothing.
|
||||
}
|
||||
}
|
||||
|
||||
static int static_v;
|
||||
|
||||
int v;
|
||||
@ -258,6 +275,7 @@ public class JdkInternalMiscUnsafeAccessTestInt {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = UNSAFE.weakCompareAndSetIntPlain(base, offset, 0x01234567, 0x89ABCDEF);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain int");
|
||||
int x = UNSAFE.getInt(base, offset);
|
||||
@ -275,6 +293,7 @@ public class JdkInternalMiscUnsafeAccessTestInt {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = UNSAFE.weakCompareAndSetIntAcquire(base, offset, 0x89ABCDEF, 0x01234567);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire int");
|
||||
int x = UNSAFE.getInt(base, offset);
|
||||
@ -292,6 +311,7 @@ public class JdkInternalMiscUnsafeAccessTestInt {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = UNSAFE.weakCompareAndSetIntRelease(base, offset, 0x01234567, 0x89ABCDEF);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease int");
|
||||
int x = UNSAFE.getInt(base, offset);
|
||||
@ -309,6 +329,7 @@ public class JdkInternalMiscUnsafeAccessTestInt {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = UNSAFE.weakCompareAndSetInt(base, offset, 0x89ABCDEF, 0x01234567);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet int");
|
||||
int x = UNSAFE.getInt(base, offset);
|
||||
|
@ -43,7 +43,14 @@ import static org.testng.Assert.*;
|
||||
|
||||
public class JdkInternalMiscUnsafeAccessTestLong {
|
||||
static final int ITERS = Integer.getInteger("iters", 1);
|
||||
static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 10);
|
||||
|
||||
// More resilience for Weak* tests. These operations may spuriously
|
||||
// fail, and so we do several attempts with delay on failure.
|
||||
// Be mindful of worst-case total time on test, which would be at
|
||||
// roughly (delay*attempts) milliseconds.
|
||||
//
|
||||
static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 100);
|
||||
static final int WEAK_DELAY_MS = Math.max(1, Integer.getInteger("weakDelay", 1));
|
||||
|
||||
static final jdk.internal.misc.Unsafe UNSAFE;
|
||||
|
||||
@ -86,6 +93,16 @@ public class JdkInternalMiscUnsafeAccessTestLong {
|
||||
ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale);
|
||||
}
|
||||
|
||||
static void weakDelay() {
|
||||
try {
|
||||
if (WEAK_DELAY_MS > 0) {
|
||||
Thread.sleep(WEAK_DELAY_MS);
|
||||
}
|
||||
} catch (InterruptedException ie) {
|
||||
// Do nothing.
|
||||
}
|
||||
}
|
||||
|
||||
static long static_v;
|
||||
|
||||
long v;
|
||||
@ -258,6 +275,7 @@ public class JdkInternalMiscUnsafeAccessTestLong {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = UNSAFE.weakCompareAndSetLongPlain(base, offset, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain long");
|
||||
long x = UNSAFE.getLong(base, offset);
|
||||
@ -275,6 +293,7 @@ public class JdkInternalMiscUnsafeAccessTestLong {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = UNSAFE.weakCompareAndSetLongAcquire(base, offset, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire long");
|
||||
long x = UNSAFE.getLong(base, offset);
|
||||
@ -292,6 +311,7 @@ public class JdkInternalMiscUnsafeAccessTestLong {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = UNSAFE.weakCompareAndSetLongRelease(base, offset, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease long");
|
||||
long x = UNSAFE.getLong(base, offset);
|
||||
@ -309,6 +329,7 @@ public class JdkInternalMiscUnsafeAccessTestLong {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = UNSAFE.weakCompareAndSetLong(base, offset, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet long");
|
||||
long x = UNSAFE.getLong(base, offset);
|
||||
|
@ -43,7 +43,14 @@ import static org.testng.Assert.*;
|
||||
|
||||
public class JdkInternalMiscUnsafeAccessTestObject {
|
||||
static final int ITERS = Integer.getInteger("iters", 1);
|
||||
static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 10);
|
||||
|
||||
// More resilience for Weak* tests. These operations may spuriously
|
||||
// fail, and so we do several attempts with delay on failure.
|
||||
// Be mindful of worst-case total time on test, which would be at
|
||||
// roughly (delay*attempts) milliseconds.
|
||||
//
|
||||
static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 100);
|
||||
static final int WEAK_DELAY_MS = Math.max(1, Integer.getInteger("weakDelay", 1));
|
||||
|
||||
static final jdk.internal.misc.Unsafe UNSAFE;
|
||||
|
||||
@ -86,6 +93,16 @@ public class JdkInternalMiscUnsafeAccessTestObject {
|
||||
ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale);
|
||||
}
|
||||
|
||||
static void weakDelay() {
|
||||
try {
|
||||
if (WEAK_DELAY_MS > 0) {
|
||||
Thread.sleep(WEAK_DELAY_MS);
|
||||
}
|
||||
} catch (InterruptedException ie) {
|
||||
// Do nothing.
|
||||
}
|
||||
}
|
||||
|
||||
static Object static_v;
|
||||
|
||||
Object v;
|
||||
@ -211,6 +228,7 @@ public class JdkInternalMiscUnsafeAccessTestObject {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = UNSAFE.weakCompareAndSetReferencePlain(base, offset, "foo", "bar");
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain Object");
|
||||
Object x = UNSAFE.getReference(base, offset);
|
||||
@ -228,6 +246,7 @@ public class JdkInternalMiscUnsafeAccessTestObject {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = UNSAFE.weakCompareAndSetReferenceAcquire(base, offset, "bar", "foo");
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire Object");
|
||||
Object x = UNSAFE.getReference(base, offset);
|
||||
@ -245,6 +264,7 @@ public class JdkInternalMiscUnsafeAccessTestObject {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = UNSAFE.weakCompareAndSetReferenceRelease(base, offset, "foo", "bar");
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease Object");
|
||||
Object x = UNSAFE.getReference(base, offset);
|
||||
@ -262,6 +282,7 @@ public class JdkInternalMiscUnsafeAccessTestObject {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = UNSAFE.weakCompareAndSetReference(base, offset, "bar", "foo");
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet Object");
|
||||
Object x = UNSAFE.getReference(base, offset);
|
||||
|
@ -43,7 +43,14 @@ import static org.testng.Assert.*;
|
||||
|
||||
public class JdkInternalMiscUnsafeAccessTestShort {
|
||||
static final int ITERS = Integer.getInteger("iters", 1);
|
||||
static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 10);
|
||||
|
||||
// More resilience for Weak* tests. These operations may spuriously
|
||||
// fail, and so we do several attempts with delay on failure.
|
||||
// Be mindful of worst-case total time on test, which would be at
|
||||
// roughly (delay*attempts) milliseconds.
|
||||
//
|
||||
static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 100);
|
||||
static final int WEAK_DELAY_MS = Math.max(1, Integer.getInteger("weakDelay", 1));
|
||||
|
||||
static final jdk.internal.misc.Unsafe UNSAFE;
|
||||
|
||||
@ -86,6 +93,16 @@ public class JdkInternalMiscUnsafeAccessTestShort {
|
||||
ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale);
|
||||
}
|
||||
|
||||
static void weakDelay() {
|
||||
try {
|
||||
if (WEAK_DELAY_MS > 0) {
|
||||
Thread.sleep(WEAK_DELAY_MS);
|
||||
}
|
||||
} catch (InterruptedException ie) {
|
||||
// Do nothing.
|
||||
}
|
||||
}
|
||||
|
||||
static short static_v;
|
||||
|
||||
short v;
|
||||
@ -258,6 +275,7 @@ public class JdkInternalMiscUnsafeAccessTestShort {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = UNSAFE.weakCompareAndSetShortPlain(base, offset, (short)0x0123, (short)0x4567);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain short");
|
||||
short x = UNSAFE.getShort(base, offset);
|
||||
@ -275,6 +293,7 @@ public class JdkInternalMiscUnsafeAccessTestShort {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = UNSAFE.weakCompareAndSetShortAcquire(base, offset, (short)0x4567, (short)0x0123);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire short");
|
||||
short x = UNSAFE.getShort(base, offset);
|
||||
@ -292,6 +311,7 @@ public class JdkInternalMiscUnsafeAccessTestShort {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = UNSAFE.weakCompareAndSetShortRelease(base, offset, (short)0x0123, (short)0x4567);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease short");
|
||||
short x = UNSAFE.getShort(base, offset);
|
||||
@ -309,6 +329,7 @@ public class JdkInternalMiscUnsafeAccessTestShort {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = UNSAFE.weakCompareAndSetShort(base, offset, (short)0x4567, (short)0x0123);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet short");
|
||||
short x = UNSAFE.getShort(base, offset);
|
||||
|
@ -43,7 +43,14 @@ import static org.testng.Assert.*;
|
||||
|
||||
public class SunMiscUnsafeAccessTestBoolean {
|
||||
static final int ITERS = Integer.getInteger("iters", 1);
|
||||
static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 10);
|
||||
|
||||
// More resilience for Weak* tests. These operations may spuriously
|
||||
// fail, and so we do several attempts with delay on failure.
|
||||
// Be mindful of worst-case total time on test, which would be at
|
||||
// roughly (delay*attempts) milliseconds.
|
||||
//
|
||||
static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 100);
|
||||
static final int WEAK_DELAY_MS = Math.max(1, Integer.getInteger("weakDelay", 1));
|
||||
|
||||
static final sun.misc.Unsafe UNSAFE;
|
||||
|
||||
@ -86,6 +93,16 @@ public class SunMiscUnsafeAccessTestBoolean {
|
||||
ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale);
|
||||
}
|
||||
|
||||
static void weakDelay() {
|
||||
try {
|
||||
if (WEAK_DELAY_MS > 0) {
|
||||
Thread.sleep(WEAK_DELAY_MS);
|
||||
}
|
||||
} catch (InterruptedException ie) {
|
||||
// Do nothing.
|
||||
}
|
||||
}
|
||||
|
||||
static boolean static_v;
|
||||
|
||||
boolean v;
|
||||
|
@ -43,7 +43,14 @@ import static org.testng.Assert.*;
|
||||
|
||||
public class SunMiscUnsafeAccessTestByte {
|
||||
static final int ITERS = Integer.getInteger("iters", 1);
|
||||
static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 10);
|
||||
|
||||
// More resilience for Weak* tests. These operations may spuriously
|
||||
// fail, and so we do several attempts with delay on failure.
|
||||
// Be mindful of worst-case total time on test, which would be at
|
||||
// roughly (delay*attempts) milliseconds.
|
||||
//
|
||||
static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 100);
|
||||
static final int WEAK_DELAY_MS = Math.max(1, Integer.getInteger("weakDelay", 1));
|
||||
|
||||
static final sun.misc.Unsafe UNSAFE;
|
||||
|
||||
@ -86,6 +93,16 @@ public class SunMiscUnsafeAccessTestByte {
|
||||
ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale);
|
||||
}
|
||||
|
||||
static void weakDelay() {
|
||||
try {
|
||||
if (WEAK_DELAY_MS > 0) {
|
||||
Thread.sleep(WEAK_DELAY_MS);
|
||||
}
|
||||
} catch (InterruptedException ie) {
|
||||
// Do nothing.
|
||||
}
|
||||
}
|
||||
|
||||
static byte static_v;
|
||||
|
||||
byte v;
|
||||
|
@ -43,7 +43,14 @@ import static org.testng.Assert.*;
|
||||
|
||||
public class SunMiscUnsafeAccessTestChar {
|
||||
static final int ITERS = Integer.getInteger("iters", 1);
|
||||
static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 10);
|
||||
|
||||
// More resilience for Weak* tests. These operations may spuriously
|
||||
// fail, and so we do several attempts with delay on failure.
|
||||
// Be mindful of worst-case total time on test, which would be at
|
||||
// roughly (delay*attempts) milliseconds.
|
||||
//
|
||||
static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 100);
|
||||
static final int WEAK_DELAY_MS = Math.max(1, Integer.getInteger("weakDelay", 1));
|
||||
|
||||
static final sun.misc.Unsafe UNSAFE;
|
||||
|
||||
@ -86,6 +93,16 @@ public class SunMiscUnsafeAccessTestChar {
|
||||
ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale);
|
||||
}
|
||||
|
||||
static void weakDelay() {
|
||||
try {
|
||||
if (WEAK_DELAY_MS > 0) {
|
||||
Thread.sleep(WEAK_DELAY_MS);
|
||||
}
|
||||
} catch (InterruptedException ie) {
|
||||
// Do nothing.
|
||||
}
|
||||
}
|
||||
|
||||
static char static_v;
|
||||
|
||||
char v;
|
||||
|
@ -43,7 +43,14 @@ import static org.testng.Assert.*;
|
||||
|
||||
public class SunMiscUnsafeAccessTestDouble {
|
||||
static final int ITERS = Integer.getInteger("iters", 1);
|
||||
static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 10);
|
||||
|
||||
// More resilience for Weak* tests. These operations may spuriously
|
||||
// fail, and so we do several attempts with delay on failure.
|
||||
// Be mindful of worst-case total time on test, which would be at
|
||||
// roughly (delay*attempts) milliseconds.
|
||||
//
|
||||
static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 100);
|
||||
static final int WEAK_DELAY_MS = Math.max(1, Integer.getInteger("weakDelay", 1));
|
||||
|
||||
static final sun.misc.Unsafe UNSAFE;
|
||||
|
||||
@ -86,6 +93,16 @@ public class SunMiscUnsafeAccessTestDouble {
|
||||
ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale);
|
||||
}
|
||||
|
||||
static void weakDelay() {
|
||||
try {
|
||||
if (WEAK_DELAY_MS > 0) {
|
||||
Thread.sleep(WEAK_DELAY_MS);
|
||||
}
|
||||
} catch (InterruptedException ie) {
|
||||
// Do nothing.
|
||||
}
|
||||
}
|
||||
|
||||
static double static_v;
|
||||
|
||||
double v;
|
||||
|
@ -43,7 +43,14 @@ import static org.testng.Assert.*;
|
||||
|
||||
public class SunMiscUnsafeAccessTestFloat {
|
||||
static final int ITERS = Integer.getInteger("iters", 1);
|
||||
static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 10);
|
||||
|
||||
// More resilience for Weak* tests. These operations may spuriously
|
||||
// fail, and so we do several attempts with delay on failure.
|
||||
// Be mindful of worst-case total time on test, which would be at
|
||||
// roughly (delay*attempts) milliseconds.
|
||||
//
|
||||
static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 100);
|
||||
static final int WEAK_DELAY_MS = Math.max(1, Integer.getInteger("weakDelay", 1));
|
||||
|
||||
static final sun.misc.Unsafe UNSAFE;
|
||||
|
||||
@ -86,6 +93,16 @@ public class SunMiscUnsafeAccessTestFloat {
|
||||
ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale);
|
||||
}
|
||||
|
||||
static void weakDelay() {
|
||||
try {
|
||||
if (WEAK_DELAY_MS > 0) {
|
||||
Thread.sleep(WEAK_DELAY_MS);
|
||||
}
|
||||
} catch (InterruptedException ie) {
|
||||
// Do nothing.
|
||||
}
|
||||
}
|
||||
|
||||
static float static_v;
|
||||
|
||||
float v;
|
||||
|
@ -43,7 +43,14 @@ import static org.testng.Assert.*;
|
||||
|
||||
public class SunMiscUnsafeAccessTestInt {
|
||||
static final int ITERS = Integer.getInteger("iters", 1);
|
||||
static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 10);
|
||||
|
||||
// More resilience for Weak* tests. These operations may spuriously
|
||||
// fail, and so we do several attempts with delay on failure.
|
||||
// Be mindful of worst-case total time on test, which would be at
|
||||
// roughly (delay*attempts) milliseconds.
|
||||
//
|
||||
static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 100);
|
||||
static final int WEAK_DELAY_MS = Math.max(1, Integer.getInteger("weakDelay", 1));
|
||||
|
||||
static final sun.misc.Unsafe UNSAFE;
|
||||
|
||||
@ -86,6 +93,16 @@ public class SunMiscUnsafeAccessTestInt {
|
||||
ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale);
|
||||
}
|
||||
|
||||
static void weakDelay() {
|
||||
try {
|
||||
if (WEAK_DELAY_MS > 0) {
|
||||
Thread.sleep(WEAK_DELAY_MS);
|
||||
}
|
||||
} catch (InterruptedException ie) {
|
||||
// Do nothing.
|
||||
}
|
||||
}
|
||||
|
||||
static int static_v;
|
||||
|
||||
int v;
|
||||
|
@ -43,7 +43,14 @@ import static org.testng.Assert.*;
|
||||
|
||||
public class SunMiscUnsafeAccessTestLong {
|
||||
static final int ITERS = Integer.getInteger("iters", 1);
|
||||
static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 10);
|
||||
|
||||
// More resilience for Weak* tests. These operations may spuriously
|
||||
// fail, and so we do several attempts with delay on failure.
|
||||
// Be mindful of worst-case total time on test, which would be at
|
||||
// roughly (delay*attempts) milliseconds.
|
||||
//
|
||||
static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 100);
|
||||
static final int WEAK_DELAY_MS = Math.max(1, Integer.getInteger("weakDelay", 1));
|
||||
|
||||
static final sun.misc.Unsafe UNSAFE;
|
||||
|
||||
@ -86,6 +93,16 @@ public class SunMiscUnsafeAccessTestLong {
|
||||
ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale);
|
||||
}
|
||||
|
||||
static void weakDelay() {
|
||||
try {
|
||||
if (WEAK_DELAY_MS > 0) {
|
||||
Thread.sleep(WEAK_DELAY_MS);
|
||||
}
|
||||
} catch (InterruptedException ie) {
|
||||
// Do nothing.
|
||||
}
|
||||
}
|
||||
|
||||
static long static_v;
|
||||
|
||||
long v;
|
||||
|
@ -43,7 +43,14 @@ import static org.testng.Assert.*;
|
||||
|
||||
public class SunMiscUnsafeAccessTestObject {
|
||||
static final int ITERS = Integer.getInteger("iters", 1);
|
||||
static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 10);
|
||||
|
||||
// More resilience for Weak* tests. These operations may spuriously
|
||||
// fail, and so we do several attempts with delay on failure.
|
||||
// Be mindful of worst-case total time on test, which would be at
|
||||
// roughly (delay*attempts) milliseconds.
|
||||
//
|
||||
static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 100);
|
||||
static final int WEAK_DELAY_MS = Math.max(1, Integer.getInteger("weakDelay", 1));
|
||||
|
||||
static final sun.misc.Unsafe UNSAFE;
|
||||
|
||||
@ -86,6 +93,16 @@ public class SunMiscUnsafeAccessTestObject {
|
||||
ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale);
|
||||
}
|
||||
|
||||
static void weakDelay() {
|
||||
try {
|
||||
if (WEAK_DELAY_MS > 0) {
|
||||
Thread.sleep(WEAK_DELAY_MS);
|
||||
}
|
||||
} catch (InterruptedException ie) {
|
||||
// Do nothing.
|
||||
}
|
||||
}
|
||||
|
||||
static Object static_v;
|
||||
|
||||
Object v;
|
||||
|
@ -43,7 +43,14 @@ import static org.testng.Assert.*;
|
||||
|
||||
public class SunMiscUnsafeAccessTestShort {
|
||||
static final int ITERS = Integer.getInteger("iters", 1);
|
||||
static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 10);
|
||||
|
||||
// More resilience for Weak* tests. These operations may spuriously
|
||||
// fail, and so we do several attempts with delay on failure.
|
||||
// Be mindful of worst-case total time on test, which would be at
|
||||
// roughly (delay*attempts) milliseconds.
|
||||
//
|
||||
static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 100);
|
||||
static final int WEAK_DELAY_MS = Math.max(1, Integer.getInteger("weakDelay", 1));
|
||||
|
||||
static final sun.misc.Unsafe UNSAFE;
|
||||
|
||||
@ -86,6 +93,16 @@ public class SunMiscUnsafeAccessTestShort {
|
||||
ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale);
|
||||
}
|
||||
|
||||
static void weakDelay() {
|
||||
try {
|
||||
if (WEAK_DELAY_MS > 0) {
|
||||
Thread.sleep(WEAK_DELAY_MS);
|
||||
}
|
||||
} catch (InterruptedException ie) {
|
||||
// Do nothing.
|
||||
}
|
||||
}
|
||||
|
||||
static short static_v;
|
||||
|
||||
short v;
|
||||
|
@ -47,7 +47,14 @@ import static org.testng.Assert.*;
|
||||
|
||||
public class $Qualifier$UnsafeAccessTest$Type$ {
|
||||
static final int ITERS = Integer.getInteger("iters", 1);
|
||||
static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 10);
|
||||
|
||||
// More resilience for Weak* tests. These operations may spuriously
|
||||
// fail, and so we do several attempts with delay on failure.
|
||||
// Be mindful of worst-case total time on test, which would be at
|
||||
// roughly (delay*attempts) milliseconds.
|
||||
//
|
||||
static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 100);
|
||||
static final int WEAK_DELAY_MS = Math.max(1, Integer.getInteger("weakDelay", 1));
|
||||
|
||||
static final $package$.Unsafe UNSAFE;
|
||||
|
||||
@ -90,6 +97,16 @@ public class $Qualifier$UnsafeAccessTest$Type$ {
|
||||
ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale);
|
||||
}
|
||||
|
||||
static void weakDelay() {
|
||||
try {
|
||||
if (WEAK_DELAY_MS > 0) {
|
||||
Thread.sleep(WEAK_DELAY_MS);
|
||||
}
|
||||
} catch (InterruptedException ie) {
|
||||
// Do nothing.
|
||||
}
|
||||
}
|
||||
|
||||
static $type$ static_v;
|
||||
|
||||
$type$ v;
|
||||
@ -302,6 +319,7 @@ public class $Qualifier$UnsafeAccessTest$Type$ {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = UNSAFE.weakCompareAndSet$MethodAffix$Plain(base, offset, $value1$, $value2$);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain $type$");
|
||||
$type$ x = UNSAFE.get$MethodAffix$(base, offset);
|
||||
@ -319,6 +337,7 @@ public class $Qualifier$UnsafeAccessTest$Type$ {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = UNSAFE.weakCompareAndSet$MethodAffix$Acquire(base, offset, $value2$, $value1$);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire $type$");
|
||||
$type$ x = UNSAFE.get$MethodAffix$(base, offset);
|
||||
@ -336,6 +355,7 @@ public class $Qualifier$UnsafeAccessTest$Type$ {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = UNSAFE.weakCompareAndSet$MethodAffix$Release(base, offset, $value1$, $value2$);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease $type$");
|
||||
$type$ x = UNSAFE.get$MethodAffix$(base, offset);
|
||||
@ -353,6 +373,7 @@ public class $Qualifier$UnsafeAccessTest$Type$ {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = UNSAFE.weakCompareAndSet$MethodAffix$(base, offset, $value2$, $value1$);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet $type$");
|
||||
$type$ x = UNSAFE.get$MethodAffix$(base, offset);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -40,7 +40,14 @@ import static org.testng.Assert.*;
|
||||
|
||||
abstract class VarHandleBaseTest {
|
||||
static final int ITERS = Integer.getInteger("iters", 1);
|
||||
static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 10);
|
||||
|
||||
// More resilience for Weak* tests. These operations may spuriously
|
||||
// fail, and so we do several attempts with delay on failure.
|
||||
// Be mindful of worst-case total time on test, which would be at
|
||||
// roughly (delay*attempts) milliseconds.
|
||||
//
|
||||
static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 100);
|
||||
static final int WEAK_DELAY_MS = Math.max(1, Integer.getInteger("weakDelay", 1));
|
||||
|
||||
interface ThrowingRunnable {
|
||||
void run() throws Throwable;
|
||||
@ -498,4 +505,14 @@ abstract class VarHandleBaseTest {
|
||||
assertEquals(mt.parameterType(mt.parameterCount() - 1), vh.varType());
|
||||
}
|
||||
}
|
||||
|
||||
static void weakDelay() {
|
||||
try {
|
||||
if (WEAK_DELAY_MS > 0) {
|
||||
Thread.sleep(WEAK_DELAY_MS);
|
||||
}
|
||||
} catch (InterruptedException ie) {
|
||||
// Do nothing.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -505,6 +505,7 @@ public class VarHandleTestAccessBoolean extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetPlain(recv, true, false);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain boolean");
|
||||
boolean x = (boolean) vh.get(recv);
|
||||
@ -522,6 +523,7 @@ public class VarHandleTestAccessBoolean extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetAcquire(recv, false, true);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire boolean");
|
||||
boolean x = (boolean) vh.get(recv);
|
||||
@ -539,6 +541,7 @@ public class VarHandleTestAccessBoolean extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetRelease(recv, true, false);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease boolean");
|
||||
boolean x = (boolean) vh.get(recv);
|
||||
@ -556,6 +559,7 @@ public class VarHandleTestAccessBoolean extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSet(recv, false, true);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet boolean");
|
||||
boolean x = (boolean) vh.get(recv);
|
||||
@ -793,6 +797,7 @@ public class VarHandleTestAccessBoolean extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetPlain(true, false);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain boolean");
|
||||
boolean x = (boolean) vh.get();
|
||||
@ -810,6 +815,7 @@ public class VarHandleTestAccessBoolean extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetAcquire(false, true);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire boolean");
|
||||
boolean x = (boolean) vh.get();
|
||||
@ -827,6 +833,7 @@ public class VarHandleTestAccessBoolean extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetRelease(true, false);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease boolean");
|
||||
boolean x = (boolean) vh.get();
|
||||
@ -844,6 +851,7 @@ public class VarHandleTestAccessBoolean extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSet(false, true);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet boolean");
|
||||
boolean x = (boolean) vh.get();
|
||||
@ -1084,6 +1092,7 @@ public class VarHandleTestAccessBoolean extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetPlain(array, i, true, false);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain boolean");
|
||||
boolean x = (boolean) vh.get(array, i);
|
||||
@ -1101,6 +1110,7 @@ public class VarHandleTestAccessBoolean extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetAcquire(array, i, false, true);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire boolean");
|
||||
boolean x = (boolean) vh.get(array, i);
|
||||
@ -1118,6 +1128,7 @@ public class VarHandleTestAccessBoolean extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetRelease(array, i, true, false);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease boolean");
|
||||
boolean x = (boolean) vh.get(array, i);
|
||||
@ -1135,6 +1146,7 @@ public class VarHandleTestAccessBoolean extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSet(array, i, false, true);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet boolean");
|
||||
boolean x = (boolean) vh.get(array, i);
|
||||
|
@ -483,6 +483,7 @@ public class VarHandleTestAccessByte extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetPlain(recv, (byte)0x01, (byte)0x23);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain byte");
|
||||
byte x = (byte) vh.get(recv);
|
||||
@ -500,6 +501,7 @@ public class VarHandleTestAccessByte extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetAcquire(recv, (byte)0x23, (byte)0x01);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire byte");
|
||||
byte x = (byte) vh.get(recv);
|
||||
@ -517,6 +519,7 @@ public class VarHandleTestAccessByte extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetRelease(recv, (byte)0x01, (byte)0x23);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease byte");
|
||||
byte x = (byte) vh.get(recv);
|
||||
@ -534,6 +537,7 @@ public class VarHandleTestAccessByte extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSet(recv, (byte)0x23, (byte)0x01);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet byte");
|
||||
byte x = (byte) vh.get(recv);
|
||||
@ -787,6 +791,7 @@ public class VarHandleTestAccessByte extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetPlain((byte)0x01, (byte)0x23);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain byte");
|
||||
byte x = (byte) vh.get();
|
||||
@ -804,6 +809,7 @@ public class VarHandleTestAccessByte extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetAcquire((byte)0x23, (byte)0x01);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire byte");
|
||||
byte x = (byte) vh.get();
|
||||
@ -821,6 +827,7 @@ public class VarHandleTestAccessByte extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetRelease((byte)0x01, (byte)0x23);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease byte");
|
||||
byte x = (byte) vh.get();
|
||||
@ -838,6 +845,7 @@ public class VarHandleTestAccessByte extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSet((byte)0x23, (byte)0x01);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet byte");
|
||||
byte x = (byte) vh.get();
|
||||
@ -1094,6 +1102,7 @@ public class VarHandleTestAccessByte extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetPlain(array, i, (byte)0x01, (byte)0x23);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain byte");
|
||||
byte x = (byte) vh.get(array, i);
|
||||
@ -1111,6 +1120,7 @@ public class VarHandleTestAccessByte extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetAcquire(array, i, (byte)0x23, (byte)0x01);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire byte");
|
||||
byte x = (byte) vh.get(array, i);
|
||||
@ -1128,6 +1138,7 @@ public class VarHandleTestAccessByte extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetRelease(array, i, (byte)0x01, (byte)0x23);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease byte");
|
||||
byte x = (byte) vh.get(array, i);
|
||||
@ -1145,6 +1156,7 @@ public class VarHandleTestAccessByte extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSet(array, i, (byte)0x23, (byte)0x01);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet byte");
|
||||
byte x = (byte) vh.get(array, i);
|
||||
|
@ -483,6 +483,7 @@ public class VarHandleTestAccessChar extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetPlain(recv, '\u0123', '\u4567');
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain char");
|
||||
char x = (char) vh.get(recv);
|
||||
@ -500,6 +501,7 @@ public class VarHandleTestAccessChar extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetAcquire(recv, '\u4567', '\u0123');
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire char");
|
||||
char x = (char) vh.get(recv);
|
||||
@ -517,6 +519,7 @@ public class VarHandleTestAccessChar extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetRelease(recv, '\u0123', '\u4567');
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease char");
|
||||
char x = (char) vh.get(recv);
|
||||
@ -534,6 +537,7 @@ public class VarHandleTestAccessChar extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSet(recv, '\u4567', '\u0123');
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet char");
|
||||
char x = (char) vh.get(recv);
|
||||
@ -787,6 +791,7 @@ public class VarHandleTestAccessChar extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetPlain('\u0123', '\u4567');
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain char");
|
||||
char x = (char) vh.get();
|
||||
@ -804,6 +809,7 @@ public class VarHandleTestAccessChar extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetAcquire('\u4567', '\u0123');
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire char");
|
||||
char x = (char) vh.get();
|
||||
@ -821,6 +827,7 @@ public class VarHandleTestAccessChar extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetRelease('\u0123', '\u4567');
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease char");
|
||||
char x = (char) vh.get();
|
||||
@ -838,6 +845,7 @@ public class VarHandleTestAccessChar extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSet('\u4567', '\u0123');
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet char");
|
||||
char x = (char) vh.get();
|
||||
@ -1094,6 +1102,7 @@ public class VarHandleTestAccessChar extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetPlain(array, i, '\u0123', '\u4567');
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain char");
|
||||
char x = (char) vh.get(array, i);
|
||||
@ -1111,6 +1120,7 @@ public class VarHandleTestAccessChar extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetAcquire(array, i, '\u4567', '\u0123');
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire char");
|
||||
char x = (char) vh.get(array, i);
|
||||
@ -1128,6 +1138,7 @@ public class VarHandleTestAccessChar extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetRelease(array, i, '\u0123', '\u4567');
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease char");
|
||||
char x = (char) vh.get(array, i);
|
||||
@ -1145,6 +1156,7 @@ public class VarHandleTestAccessChar extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSet(array, i, '\u4567', '\u0123');
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet char");
|
||||
char x = (char) vh.get(array, i);
|
||||
|
@ -553,6 +553,7 @@ public class VarHandleTestAccessDouble extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetPlain(recv, 1.0d, 2.0d);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain double");
|
||||
double x = (double) vh.get(recv);
|
||||
@ -570,6 +571,7 @@ public class VarHandleTestAccessDouble extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetAcquire(recv, 2.0d, 1.0d);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire double");
|
||||
double x = (double) vh.get(recv);
|
||||
@ -587,6 +589,7 @@ public class VarHandleTestAccessDouble extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetRelease(recv, 1.0d, 2.0d);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease double");
|
||||
double x = (double) vh.get(recv);
|
||||
@ -604,6 +607,7 @@ public class VarHandleTestAccessDouble extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSet(recv, 2.0d, 1.0d);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet double");
|
||||
double x = (double) vh.get(recv);
|
||||
@ -809,6 +813,7 @@ public class VarHandleTestAccessDouble extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetPlain(1.0d, 2.0d);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain double");
|
||||
double x = (double) vh.get();
|
||||
@ -826,6 +831,7 @@ public class VarHandleTestAccessDouble extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetAcquire(2.0d, 1.0d);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire double");
|
||||
double x = (double) vh.get();
|
||||
@ -843,6 +849,7 @@ public class VarHandleTestAccessDouble extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetRelease(1.0d, 2.0d);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease double");
|
||||
double x = (double) vh.get();
|
||||
@ -860,6 +867,7 @@ public class VarHandleTestAccessDouble extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSet(2.0d, 1.0d);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet double");
|
||||
double x = (double) vh.get();
|
||||
@ -1068,6 +1076,7 @@ public class VarHandleTestAccessDouble extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetPlain(array, i, 1.0d, 2.0d);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain double");
|
||||
double x = (double) vh.get(array, i);
|
||||
@ -1085,6 +1094,7 @@ public class VarHandleTestAccessDouble extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetAcquire(array, i, 2.0d, 1.0d);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire double");
|
||||
double x = (double) vh.get(array, i);
|
||||
@ -1102,6 +1112,7 @@ public class VarHandleTestAccessDouble extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetRelease(array, i, 1.0d, 2.0d);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease double");
|
||||
double x = (double) vh.get(array, i);
|
||||
@ -1119,6 +1130,7 @@ public class VarHandleTestAccessDouble extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSet(array, i, 2.0d, 1.0d);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet double");
|
||||
double x = (double) vh.get(array, i);
|
||||
|
@ -553,6 +553,7 @@ public class VarHandleTestAccessFloat extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetPlain(recv, 1.0f, 2.0f);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain float");
|
||||
float x = (float) vh.get(recv);
|
||||
@ -570,6 +571,7 @@ public class VarHandleTestAccessFloat extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetAcquire(recv, 2.0f, 1.0f);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire float");
|
||||
float x = (float) vh.get(recv);
|
||||
@ -587,6 +589,7 @@ public class VarHandleTestAccessFloat extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetRelease(recv, 1.0f, 2.0f);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease float");
|
||||
float x = (float) vh.get(recv);
|
||||
@ -604,6 +607,7 @@ public class VarHandleTestAccessFloat extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSet(recv, 2.0f, 1.0f);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet float");
|
||||
float x = (float) vh.get(recv);
|
||||
@ -809,6 +813,7 @@ public class VarHandleTestAccessFloat extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetPlain(1.0f, 2.0f);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain float");
|
||||
float x = (float) vh.get();
|
||||
@ -826,6 +831,7 @@ public class VarHandleTestAccessFloat extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetAcquire(2.0f, 1.0f);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire float");
|
||||
float x = (float) vh.get();
|
||||
@ -843,6 +849,7 @@ public class VarHandleTestAccessFloat extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetRelease(1.0f, 2.0f);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease float");
|
||||
float x = (float) vh.get();
|
||||
@ -860,6 +867,7 @@ public class VarHandleTestAccessFloat extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSet(2.0f, 1.0f);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet float");
|
||||
float x = (float) vh.get();
|
||||
@ -1068,6 +1076,7 @@ public class VarHandleTestAccessFloat extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetPlain(array, i, 1.0f, 2.0f);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain float");
|
||||
float x = (float) vh.get(array, i);
|
||||
@ -1085,6 +1094,7 @@ public class VarHandleTestAccessFloat extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetAcquire(array, i, 2.0f, 1.0f);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire float");
|
||||
float x = (float) vh.get(array, i);
|
||||
@ -1102,6 +1112,7 @@ public class VarHandleTestAccessFloat extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetRelease(array, i, 1.0f, 2.0f);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease float");
|
||||
float x = (float) vh.get(array, i);
|
||||
@ -1119,6 +1130,7 @@ public class VarHandleTestAccessFloat extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSet(array, i, 2.0f, 1.0f);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet float");
|
||||
float x = (float) vh.get(array, i);
|
||||
|
@ -483,6 +483,7 @@ public class VarHandleTestAccessInt extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetPlain(recv, 0x01234567, 0x89ABCDEF);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain int");
|
||||
int x = (int) vh.get(recv);
|
||||
@ -500,6 +501,7 @@ public class VarHandleTestAccessInt extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetAcquire(recv, 0x89ABCDEF, 0x01234567);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire int");
|
||||
int x = (int) vh.get(recv);
|
||||
@ -517,6 +519,7 @@ public class VarHandleTestAccessInt extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetRelease(recv, 0x01234567, 0x89ABCDEF);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease int");
|
||||
int x = (int) vh.get(recv);
|
||||
@ -534,6 +537,7 @@ public class VarHandleTestAccessInt extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSet(recv, 0x89ABCDEF, 0x01234567);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet int");
|
||||
int x = (int) vh.get(recv);
|
||||
@ -787,6 +791,7 @@ public class VarHandleTestAccessInt extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetPlain(0x01234567, 0x89ABCDEF);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain int");
|
||||
int x = (int) vh.get();
|
||||
@ -804,6 +809,7 @@ public class VarHandleTestAccessInt extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetAcquire(0x89ABCDEF, 0x01234567);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire int");
|
||||
int x = (int) vh.get();
|
||||
@ -821,6 +827,7 @@ public class VarHandleTestAccessInt extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetRelease(0x01234567, 0x89ABCDEF);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease int");
|
||||
int x = (int) vh.get();
|
||||
@ -838,6 +845,7 @@ public class VarHandleTestAccessInt extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSet(0x89ABCDEF, 0x01234567);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet int");
|
||||
int x = (int) vh.get();
|
||||
@ -1094,6 +1102,7 @@ public class VarHandleTestAccessInt extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetPlain(array, i, 0x01234567, 0x89ABCDEF);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain int");
|
||||
int x = (int) vh.get(array, i);
|
||||
@ -1111,6 +1120,7 @@ public class VarHandleTestAccessInt extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetAcquire(array, i, 0x89ABCDEF, 0x01234567);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire int");
|
||||
int x = (int) vh.get(array, i);
|
||||
@ -1128,6 +1138,7 @@ public class VarHandleTestAccessInt extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetRelease(array, i, 0x01234567, 0x89ABCDEF);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease int");
|
||||
int x = (int) vh.get(array, i);
|
||||
@ -1145,6 +1156,7 @@ public class VarHandleTestAccessInt extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSet(array, i, 0x89ABCDEF, 0x01234567);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet int");
|
||||
int x = (int) vh.get(array, i);
|
||||
|
@ -483,6 +483,7 @@ public class VarHandleTestAccessLong extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetPlain(recv, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain long");
|
||||
long x = (long) vh.get(recv);
|
||||
@ -500,6 +501,7 @@ public class VarHandleTestAccessLong extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetAcquire(recv, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire long");
|
||||
long x = (long) vh.get(recv);
|
||||
@ -517,6 +519,7 @@ public class VarHandleTestAccessLong extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetRelease(recv, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease long");
|
||||
long x = (long) vh.get(recv);
|
||||
@ -534,6 +537,7 @@ public class VarHandleTestAccessLong extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSet(recv, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet long");
|
||||
long x = (long) vh.get(recv);
|
||||
@ -787,6 +791,7 @@ public class VarHandleTestAccessLong extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetPlain(0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain long");
|
||||
long x = (long) vh.get();
|
||||
@ -804,6 +809,7 @@ public class VarHandleTestAccessLong extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetAcquire(0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire long");
|
||||
long x = (long) vh.get();
|
||||
@ -821,6 +827,7 @@ public class VarHandleTestAccessLong extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetRelease(0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease long");
|
||||
long x = (long) vh.get();
|
||||
@ -838,6 +845,7 @@ public class VarHandleTestAccessLong extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSet(0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet long");
|
||||
long x = (long) vh.get();
|
||||
@ -1094,6 +1102,7 @@ public class VarHandleTestAccessLong extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetPlain(array, i, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain long");
|
||||
long x = (long) vh.get(array, i);
|
||||
@ -1111,6 +1120,7 @@ public class VarHandleTestAccessLong extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetAcquire(array, i, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire long");
|
||||
long x = (long) vh.get(array, i);
|
||||
@ -1128,6 +1138,7 @@ public class VarHandleTestAccessLong extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetRelease(array, i, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease long");
|
||||
long x = (long) vh.get(array, i);
|
||||
@ -1145,6 +1156,7 @@ public class VarHandleTestAccessLong extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSet(array, i, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet long");
|
||||
long x = (long) vh.get(array, i);
|
||||
|
@ -483,6 +483,7 @@ public class VarHandleTestAccessShort extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetPlain(recv, (short)0x0123, (short)0x4567);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain short");
|
||||
short x = (short) vh.get(recv);
|
||||
@ -500,6 +501,7 @@ public class VarHandleTestAccessShort extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetAcquire(recv, (short)0x4567, (short)0x0123);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire short");
|
||||
short x = (short) vh.get(recv);
|
||||
@ -517,6 +519,7 @@ public class VarHandleTestAccessShort extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetRelease(recv, (short)0x0123, (short)0x4567);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease short");
|
||||
short x = (short) vh.get(recv);
|
||||
@ -534,6 +537,7 @@ public class VarHandleTestAccessShort extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSet(recv, (short)0x4567, (short)0x0123);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet short");
|
||||
short x = (short) vh.get(recv);
|
||||
@ -787,6 +791,7 @@ public class VarHandleTestAccessShort extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetPlain((short)0x0123, (short)0x4567);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain short");
|
||||
short x = (short) vh.get();
|
||||
@ -804,6 +809,7 @@ public class VarHandleTestAccessShort extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetAcquire((short)0x4567, (short)0x0123);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire short");
|
||||
short x = (short) vh.get();
|
||||
@ -821,6 +827,7 @@ public class VarHandleTestAccessShort extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetRelease((short)0x0123, (short)0x4567);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease short");
|
||||
short x = (short) vh.get();
|
||||
@ -838,6 +845,7 @@ public class VarHandleTestAccessShort extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSet((short)0x4567, (short)0x0123);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet short");
|
||||
short x = (short) vh.get();
|
||||
@ -1094,6 +1102,7 @@ public class VarHandleTestAccessShort extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetPlain(array, i, (short)0x0123, (short)0x4567);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain short");
|
||||
short x = (short) vh.get(array, i);
|
||||
@ -1111,6 +1120,7 @@ public class VarHandleTestAccessShort extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetAcquire(array, i, (short)0x4567, (short)0x0123);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire short");
|
||||
short x = (short) vh.get(array, i);
|
||||
@ -1128,6 +1138,7 @@ public class VarHandleTestAccessShort extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetRelease(array, i, (short)0x0123, (short)0x4567);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease short");
|
||||
short x = (short) vh.get(array, i);
|
||||
@ -1145,6 +1156,7 @@ public class VarHandleTestAccessShort extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSet(array, i, (short)0x4567, (short)0x0123);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet short");
|
||||
short x = (short) vh.get(array, i);
|
||||
|
@ -582,6 +582,7 @@ public class VarHandleTestAccessString extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetPlain(recv, "foo", "bar");
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain String");
|
||||
String x = (String) vh.get(recv);
|
||||
@ -599,6 +600,7 @@ public class VarHandleTestAccessString extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetAcquire(recv, "bar", "foo");
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire String");
|
||||
String x = (String) vh.get(recv);
|
||||
@ -616,6 +618,7 @@ public class VarHandleTestAccessString extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetRelease(recv, "foo", "bar");
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease String");
|
||||
String x = (String) vh.get(recv);
|
||||
@ -633,6 +636,7 @@ public class VarHandleTestAccessString extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSet(recv, "bar", "foo");
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet String");
|
||||
String x = (String) vh.get(recv);
|
||||
@ -822,6 +826,7 @@ public class VarHandleTestAccessString extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetPlain("foo", "bar");
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain String");
|
||||
String x = (String) vh.get();
|
||||
@ -839,6 +844,7 @@ public class VarHandleTestAccessString extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetAcquire("bar", "foo");
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire String");
|
||||
String x = (String) vh.get();
|
||||
@ -856,6 +862,7 @@ public class VarHandleTestAccessString extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetRelease("foo", "bar");
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease String");
|
||||
String x = (String) vh.get();
|
||||
@ -873,6 +880,7 @@ public class VarHandleTestAccessString extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSet("bar", "foo");
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet String");
|
||||
String x = (String) vh.get();
|
||||
@ -1065,6 +1073,7 @@ public class VarHandleTestAccessString extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetPlain(array, i, "foo", "bar");
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain String");
|
||||
String x = (String) vh.get(array, i);
|
||||
@ -1082,6 +1091,7 @@ public class VarHandleTestAccessString extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetAcquire(array, i, "bar", "foo");
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire String");
|
||||
String x = (String) vh.get(array, i);
|
||||
@ -1099,6 +1109,7 @@ public class VarHandleTestAccessString extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetRelease(array, i, "foo", "bar");
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease String");
|
||||
String x = (String) vh.get(array, i);
|
||||
@ -1116,6 +1127,7 @@ public class VarHandleTestAccessString extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSet(array, i, "bar", "foo");
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet String");
|
||||
String x = (String) vh.get(array, i);
|
||||
|
@ -1081,6 +1081,7 @@ public class VarHandleTestByteArrayAsDouble extends VarHandleBaseByteArrayTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetPlain(array, i, VALUE_1, VALUE_2);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain double");
|
||||
double x = (double) vh.get(array, i);
|
||||
@ -1098,6 +1099,7 @@ public class VarHandleTestByteArrayAsDouble extends VarHandleBaseByteArrayTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetAcquire(array, i, VALUE_2, VALUE_1);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire double");
|
||||
double x = (double) vh.get(array, i);
|
||||
@ -1115,6 +1117,7 @@ public class VarHandleTestByteArrayAsDouble extends VarHandleBaseByteArrayTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetRelease(array, i, VALUE_1, VALUE_2);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease double");
|
||||
double x = (double) vh.get(array, i);
|
||||
@ -1132,6 +1135,7 @@ public class VarHandleTestByteArrayAsDouble extends VarHandleBaseByteArrayTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSet(array, i, VALUE_2, VALUE_1);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet double");
|
||||
double x = (double) vh.get(array, i);
|
||||
@ -1282,6 +1286,7 @@ public class VarHandleTestByteArrayAsDouble extends VarHandleBaseByteArrayTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetPlain(array, i, VALUE_1, VALUE_2);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain double");
|
||||
double x = (double) vh.get(array, i);
|
||||
@ -1299,6 +1304,7 @@ public class VarHandleTestByteArrayAsDouble extends VarHandleBaseByteArrayTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetAcquire(array, i, VALUE_2, VALUE_1);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire double");
|
||||
double x = (double) vh.get(array, i);
|
||||
@ -1316,6 +1322,7 @@ public class VarHandleTestByteArrayAsDouble extends VarHandleBaseByteArrayTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetRelease(array, i, VALUE_1, VALUE_2);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease double");
|
||||
double x = (double) vh.get(array, i);
|
||||
@ -1333,6 +1340,7 @@ public class VarHandleTestByteArrayAsDouble extends VarHandleBaseByteArrayTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSet(array, i, VALUE_2, VALUE_1);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet double");
|
||||
double x = (double) vh.get(array, i);
|
||||
|
@ -1081,6 +1081,7 @@ public class VarHandleTestByteArrayAsFloat extends VarHandleBaseByteArrayTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetPlain(array, i, VALUE_1, VALUE_2);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain float");
|
||||
float x = (float) vh.get(array, i);
|
||||
@ -1098,6 +1099,7 @@ public class VarHandleTestByteArrayAsFloat extends VarHandleBaseByteArrayTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetAcquire(array, i, VALUE_2, VALUE_1);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire float");
|
||||
float x = (float) vh.get(array, i);
|
||||
@ -1115,6 +1117,7 @@ public class VarHandleTestByteArrayAsFloat extends VarHandleBaseByteArrayTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetRelease(array, i, VALUE_1, VALUE_2);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease float");
|
||||
float x = (float) vh.get(array, i);
|
||||
@ -1132,6 +1135,7 @@ public class VarHandleTestByteArrayAsFloat extends VarHandleBaseByteArrayTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSet(array, i, VALUE_2, VALUE_1);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet float");
|
||||
float x = (float) vh.get(array, i);
|
||||
@ -1282,6 +1286,7 @@ public class VarHandleTestByteArrayAsFloat extends VarHandleBaseByteArrayTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetPlain(array, i, VALUE_1, VALUE_2);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain float");
|
||||
float x = (float) vh.get(array, i);
|
||||
@ -1299,6 +1304,7 @@ public class VarHandleTestByteArrayAsFloat extends VarHandleBaseByteArrayTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetAcquire(array, i, VALUE_2, VALUE_1);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire float");
|
||||
float x = (float) vh.get(array, i);
|
||||
@ -1316,6 +1322,7 @@ public class VarHandleTestByteArrayAsFloat extends VarHandleBaseByteArrayTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetRelease(array, i, VALUE_1, VALUE_2);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease float");
|
||||
float x = (float) vh.get(array, i);
|
||||
@ -1333,6 +1340,7 @@ public class VarHandleTestByteArrayAsFloat extends VarHandleBaseByteArrayTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSet(array, i, VALUE_2, VALUE_1);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet float");
|
||||
float x = (float) vh.get(array, i);
|
||||
|
@ -1265,6 +1265,7 @@ public class VarHandleTestByteArrayAsInt extends VarHandleBaseByteArrayTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetPlain(array, i, VALUE_1, VALUE_2);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain int");
|
||||
int x = (int) vh.get(array, i);
|
||||
@ -1282,6 +1283,7 @@ public class VarHandleTestByteArrayAsInt extends VarHandleBaseByteArrayTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetAcquire(array, i, VALUE_2, VALUE_1);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire int");
|
||||
int x = (int) vh.get(array, i);
|
||||
@ -1299,6 +1301,7 @@ public class VarHandleTestByteArrayAsInt extends VarHandleBaseByteArrayTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetRelease(array, i, VALUE_1, VALUE_2);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease int");
|
||||
int x = (int) vh.get(array, i);
|
||||
@ -1316,6 +1319,7 @@ public class VarHandleTestByteArrayAsInt extends VarHandleBaseByteArrayTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSet(array, i, VALUE_2, VALUE_1);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet int");
|
||||
int x = (int) vh.get(array, i);
|
||||
@ -1576,6 +1580,7 @@ public class VarHandleTestByteArrayAsInt extends VarHandleBaseByteArrayTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetPlain(array, i, VALUE_1, VALUE_2);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain int");
|
||||
int x = (int) vh.get(array, i);
|
||||
@ -1593,6 +1598,7 @@ public class VarHandleTestByteArrayAsInt extends VarHandleBaseByteArrayTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetAcquire(array, i, VALUE_2, VALUE_1);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire int");
|
||||
int x = (int) vh.get(array, i);
|
||||
@ -1610,6 +1616,7 @@ public class VarHandleTestByteArrayAsInt extends VarHandleBaseByteArrayTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetRelease(array, i, VALUE_1, VALUE_2);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease int");
|
||||
int x = (int) vh.get(array, i);
|
||||
@ -1627,6 +1634,7 @@ public class VarHandleTestByteArrayAsInt extends VarHandleBaseByteArrayTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSet(array, i, VALUE_2, VALUE_1);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet int");
|
||||
int x = (int) vh.get(array, i);
|
||||
|
@ -1265,6 +1265,7 @@ public class VarHandleTestByteArrayAsLong extends VarHandleBaseByteArrayTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetPlain(array, i, VALUE_1, VALUE_2);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain long");
|
||||
long x = (long) vh.get(array, i);
|
||||
@ -1282,6 +1283,7 @@ public class VarHandleTestByteArrayAsLong extends VarHandleBaseByteArrayTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetAcquire(array, i, VALUE_2, VALUE_1);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire long");
|
||||
long x = (long) vh.get(array, i);
|
||||
@ -1299,6 +1301,7 @@ public class VarHandleTestByteArrayAsLong extends VarHandleBaseByteArrayTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetRelease(array, i, VALUE_1, VALUE_2);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease long");
|
||||
long x = (long) vh.get(array, i);
|
||||
@ -1316,6 +1319,7 @@ public class VarHandleTestByteArrayAsLong extends VarHandleBaseByteArrayTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSet(array, i, VALUE_2, VALUE_1);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet long");
|
||||
long x = (long) vh.get(array, i);
|
||||
@ -1576,6 +1580,7 @@ public class VarHandleTestByteArrayAsLong extends VarHandleBaseByteArrayTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetPlain(array, i, VALUE_1, VALUE_2);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain long");
|
||||
long x = (long) vh.get(array, i);
|
||||
@ -1593,6 +1598,7 @@ public class VarHandleTestByteArrayAsLong extends VarHandleBaseByteArrayTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetAcquire(array, i, VALUE_2, VALUE_1);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire long");
|
||||
long x = (long) vh.get(array, i);
|
||||
@ -1610,6 +1616,7 @@ public class VarHandleTestByteArrayAsLong extends VarHandleBaseByteArrayTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetRelease(array, i, VALUE_1, VALUE_2);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease long");
|
||||
long x = (long) vh.get(array, i);
|
||||
@ -1627,6 +1634,7 @@ public class VarHandleTestByteArrayAsLong extends VarHandleBaseByteArrayTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSet(array, i, VALUE_2, VALUE_1);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet long");
|
||||
long x = (long) vh.get(array, i);
|
||||
|
@ -30,6 +30,7 @@ import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import java.lang.invoke.MethodHandle;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
import java.util.ArrayList;
|
||||
@ -208,9 +209,11 @@ public class VarHandleTestMethodHandleAccessBoolean extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(recv, true, false);
|
||||
success = (boolean) mh.invokeExact(recv, true, false);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain boolean");
|
||||
boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(recv);
|
||||
@ -225,9 +228,11 @@ public class VarHandleTestMethodHandleAccessBoolean extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(recv, false, true);
|
||||
success = (boolean) mh.invokeExact(recv, false, true);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire boolean");
|
||||
boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(recv);
|
||||
@ -242,9 +247,11 @@ public class VarHandleTestMethodHandleAccessBoolean extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(recv, true, false);
|
||||
success = (boolean) mh.invokeExact(recv, true, false);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease boolean");
|
||||
boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(recv);
|
||||
@ -260,8 +267,10 @@ public class VarHandleTestMethodHandleAccessBoolean extends VarHandleBaseTest {
|
||||
|
||||
{
|
||||
boolean success = false;
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET);
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, false, true);
|
||||
success = (boolean) mh.invokeExact(recv, false, true);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet boolean");
|
||||
boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(recv);
|
||||
@ -470,9 +479,11 @@ public class VarHandleTestMethodHandleAccessBoolean extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(true, false);
|
||||
success = (boolean) mh.invokeExact(true, false);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain boolean");
|
||||
boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact();
|
||||
@ -487,9 +498,11 @@ public class VarHandleTestMethodHandleAccessBoolean extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(false, true);
|
||||
success = (boolean) mh.invokeExact(false, true);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire boolean");
|
||||
boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact();
|
||||
@ -497,16 +510,19 @@ public class VarHandleTestMethodHandleAccessBoolean extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
boolean success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(false, false);
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE);
|
||||
boolean success = (boolean) mh.invokeExact(false, false);
|
||||
assertEquals(success, false, "failing weakCompareAndSetAcquire boolean");
|
||||
boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact();
|
||||
assertEquals(x, true, "failing weakCompareAndSetAcquire boolean value");
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(true, false);
|
||||
success = (boolean) mh.invokeExact(true, false);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease boolean");
|
||||
boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact();
|
||||
@ -521,9 +537,11 @@ public class VarHandleTestMethodHandleAccessBoolean extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(false, true);
|
||||
success = (boolean) mh.invokeExact(false, true);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet boolean");
|
||||
boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact();
|
||||
@ -757,9 +775,11 @@ public class VarHandleTestMethodHandleAccessBoolean extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(array, i, true, false);
|
||||
success = (boolean) mh.invokeExact(array, i, true, false);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain boolean");
|
||||
boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(array, i);
|
||||
@ -774,9 +794,11 @@ public class VarHandleTestMethodHandleAccessBoolean extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(array, i, false, true);
|
||||
success = (boolean) mh.invokeExact(array, i, false, true);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire boolean");
|
||||
boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(array, i);
|
||||
@ -791,9 +813,11 @@ public class VarHandleTestMethodHandleAccessBoolean extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(array, i, true, false);
|
||||
success = (boolean) mh.invokeExact(array, i, true, false);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease boolean");
|
||||
boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(array, i);
|
||||
@ -808,9 +832,11 @@ public class VarHandleTestMethodHandleAccessBoolean extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, false, true);
|
||||
success = (boolean) mh.invokeExact(array, i, false, true);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet boolean");
|
||||
boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(array, i);
|
||||
|
@ -30,6 +30,7 @@ import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import java.lang.invoke.MethodHandle;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
import java.util.ArrayList;
|
||||
@ -208,9 +209,11 @@ public class VarHandleTestMethodHandleAccessByte extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(recv, (byte)0x01, (byte)0x23);
|
||||
success = (boolean) mh.invokeExact(recv, (byte)0x01, (byte)0x23);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain byte");
|
||||
byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(recv);
|
||||
@ -225,9 +228,11 @@ public class VarHandleTestMethodHandleAccessByte extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(recv, (byte)0x23, (byte)0x01);
|
||||
success = (boolean) mh.invokeExact(recv, (byte)0x23, (byte)0x01);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire byte");
|
||||
byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(recv);
|
||||
@ -242,9 +247,11 @@ public class VarHandleTestMethodHandleAccessByte extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(recv, (byte)0x01, (byte)0x23);
|
||||
success = (boolean) mh.invokeExact(recv, (byte)0x01, (byte)0x23);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease byte");
|
||||
byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(recv);
|
||||
@ -260,8 +267,10 @@ public class VarHandleTestMethodHandleAccessByte extends VarHandleBaseTest {
|
||||
|
||||
{
|
||||
boolean success = false;
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET);
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, (byte)0x23, (byte)0x01);
|
||||
success = (boolean) mh.invokeExact(recv, (byte)0x23, (byte)0x01);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet byte");
|
||||
byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(recv);
|
||||
@ -492,9 +501,11 @@ public class VarHandleTestMethodHandleAccessByte extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact((byte)0x01, (byte)0x23);
|
||||
success = (boolean) mh.invokeExact((byte)0x01, (byte)0x23);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain byte");
|
||||
byte x = (byte) hs.get(TestAccessMode.GET).invokeExact();
|
||||
@ -509,9 +520,11 @@ public class VarHandleTestMethodHandleAccessByte extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact((byte)0x23, (byte)0x01);
|
||||
success = (boolean) mh.invokeExact((byte)0x23, (byte)0x01);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire byte");
|
||||
byte x = (byte) hs.get(TestAccessMode.GET).invokeExact();
|
||||
@ -519,16 +532,19 @@ public class VarHandleTestMethodHandleAccessByte extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
boolean success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact((byte)0x23, (byte)0x45);
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE);
|
||||
boolean success = (boolean) mh.invokeExact((byte)0x23, (byte)0x45);
|
||||
assertEquals(success, false, "failing weakCompareAndSetAcquire byte");
|
||||
byte x = (byte) hs.get(TestAccessMode.GET).invokeExact();
|
||||
assertEquals(x, (byte)0x01, "failing weakCompareAndSetAcquire byte value");
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact((byte)0x01, (byte)0x23);
|
||||
success = (boolean) mh.invokeExact((byte)0x01, (byte)0x23);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease byte");
|
||||
byte x = (byte) hs.get(TestAccessMode.GET).invokeExact();
|
||||
@ -543,9 +559,11 @@ public class VarHandleTestMethodHandleAccessByte extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact((byte)0x23, (byte)0x01);
|
||||
success = (boolean) mh.invokeExact((byte)0x23, (byte)0x01);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet byte");
|
||||
byte x = (byte) hs.get(TestAccessMode.GET).invokeExact();
|
||||
@ -801,9 +819,11 @@ public class VarHandleTestMethodHandleAccessByte extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(array, i, (byte)0x01, (byte)0x23);
|
||||
success = (boolean) mh.invokeExact(array, i, (byte)0x01, (byte)0x23);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain byte");
|
||||
byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(array, i);
|
||||
@ -818,9 +838,11 @@ public class VarHandleTestMethodHandleAccessByte extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(array, i, (byte)0x23, (byte)0x01);
|
||||
success = (boolean) mh.invokeExact(array, i, (byte)0x23, (byte)0x01);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire byte");
|
||||
byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(array, i);
|
||||
@ -835,9 +857,11 @@ public class VarHandleTestMethodHandleAccessByte extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(array, i, (byte)0x01, (byte)0x23);
|
||||
success = (boolean) mh.invokeExact(array, i, (byte)0x01, (byte)0x23);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease byte");
|
||||
byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(array, i);
|
||||
@ -852,9 +876,11 @@ public class VarHandleTestMethodHandleAccessByte extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, (byte)0x23, (byte)0x01);
|
||||
success = (boolean) mh.invokeExact(array, i, (byte)0x23, (byte)0x01);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet byte");
|
||||
byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(array, i);
|
||||
|
@ -30,6 +30,7 @@ import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import java.lang.invoke.MethodHandle;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
import java.util.ArrayList;
|
||||
@ -208,9 +209,11 @@ public class VarHandleTestMethodHandleAccessChar extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(recv, '\u0123', '\u4567');
|
||||
success = (boolean) mh.invokeExact(recv, '\u0123', '\u4567');
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain char");
|
||||
char x = (char) hs.get(TestAccessMode.GET).invokeExact(recv);
|
||||
@ -225,9 +228,11 @@ public class VarHandleTestMethodHandleAccessChar extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(recv, '\u4567', '\u0123');
|
||||
success = (boolean) mh.invokeExact(recv, '\u4567', '\u0123');
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire char");
|
||||
char x = (char) hs.get(TestAccessMode.GET).invokeExact(recv);
|
||||
@ -242,9 +247,11 @@ public class VarHandleTestMethodHandleAccessChar extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(recv, '\u0123', '\u4567');
|
||||
success = (boolean) mh.invokeExact(recv, '\u0123', '\u4567');
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease char");
|
||||
char x = (char) hs.get(TestAccessMode.GET).invokeExact(recv);
|
||||
@ -260,8 +267,10 @@ public class VarHandleTestMethodHandleAccessChar extends VarHandleBaseTest {
|
||||
|
||||
{
|
||||
boolean success = false;
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET);
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, '\u4567', '\u0123');
|
||||
success = (boolean) mh.invokeExact(recv, '\u4567', '\u0123');
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet char");
|
||||
char x = (char) hs.get(TestAccessMode.GET).invokeExact(recv);
|
||||
@ -492,9 +501,11 @@ public class VarHandleTestMethodHandleAccessChar extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact('\u0123', '\u4567');
|
||||
success = (boolean) mh.invokeExact('\u0123', '\u4567');
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain char");
|
||||
char x = (char) hs.get(TestAccessMode.GET).invokeExact();
|
||||
@ -509,9 +520,11 @@ public class VarHandleTestMethodHandleAccessChar extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact('\u4567', '\u0123');
|
||||
success = (boolean) mh.invokeExact('\u4567', '\u0123');
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire char");
|
||||
char x = (char) hs.get(TestAccessMode.GET).invokeExact();
|
||||
@ -519,16 +532,19 @@ public class VarHandleTestMethodHandleAccessChar extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
boolean success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact('\u4567', '\u89AB');
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE);
|
||||
boolean success = (boolean) mh.invokeExact('\u4567', '\u89AB');
|
||||
assertEquals(success, false, "failing weakCompareAndSetAcquire char");
|
||||
char x = (char) hs.get(TestAccessMode.GET).invokeExact();
|
||||
assertEquals(x, '\u0123', "failing weakCompareAndSetAcquire char value");
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact('\u0123', '\u4567');
|
||||
success = (boolean) mh.invokeExact('\u0123', '\u4567');
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease char");
|
||||
char x = (char) hs.get(TestAccessMode.GET).invokeExact();
|
||||
@ -543,9 +559,11 @@ public class VarHandleTestMethodHandleAccessChar extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact('\u4567', '\u0123');
|
||||
success = (boolean) mh.invokeExact('\u4567', '\u0123');
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet char");
|
||||
char x = (char) hs.get(TestAccessMode.GET).invokeExact();
|
||||
@ -801,9 +819,11 @@ public class VarHandleTestMethodHandleAccessChar extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(array, i, '\u0123', '\u4567');
|
||||
success = (boolean) mh.invokeExact(array, i, '\u0123', '\u4567');
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain char");
|
||||
char x = (char) hs.get(TestAccessMode.GET).invokeExact(array, i);
|
||||
@ -818,9 +838,11 @@ public class VarHandleTestMethodHandleAccessChar extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(array, i, '\u4567', '\u0123');
|
||||
success = (boolean) mh.invokeExact(array, i, '\u4567', '\u0123');
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire char");
|
||||
char x = (char) hs.get(TestAccessMode.GET).invokeExact(array, i);
|
||||
@ -835,9 +857,11 @@ public class VarHandleTestMethodHandleAccessChar extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(array, i, '\u0123', '\u4567');
|
||||
success = (boolean) mh.invokeExact(array, i, '\u0123', '\u4567');
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease char");
|
||||
char x = (char) hs.get(TestAccessMode.GET).invokeExact(array, i);
|
||||
@ -852,9 +876,11 @@ public class VarHandleTestMethodHandleAccessChar extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, '\u4567', '\u0123');
|
||||
success = (boolean) mh.invokeExact(array, i, '\u4567', '\u0123');
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet char");
|
||||
char x = (char) hs.get(TestAccessMode.GET).invokeExact(array, i);
|
||||
|
@ -30,6 +30,7 @@ import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import java.lang.invoke.MethodHandle;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
import java.util.ArrayList;
|
||||
@ -208,9 +209,11 @@ public class VarHandleTestMethodHandleAccessDouble extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(recv, 1.0d, 2.0d);
|
||||
success = (boolean) mh.invokeExact(recv, 1.0d, 2.0d);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain double");
|
||||
double x = (double) hs.get(TestAccessMode.GET).invokeExact(recv);
|
||||
@ -225,9 +228,11 @@ public class VarHandleTestMethodHandleAccessDouble extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(recv, 2.0d, 1.0d);
|
||||
success = (boolean) mh.invokeExact(recv, 2.0d, 1.0d);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire double");
|
||||
double x = (double) hs.get(TestAccessMode.GET).invokeExact(recv);
|
||||
@ -242,9 +247,11 @@ public class VarHandleTestMethodHandleAccessDouble extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(recv, 1.0d, 2.0d);
|
||||
success = (boolean) mh.invokeExact(recv, 1.0d, 2.0d);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease double");
|
||||
double x = (double) hs.get(TestAccessMode.GET).invokeExact(recv);
|
||||
@ -260,8 +267,10 @@ public class VarHandleTestMethodHandleAccessDouble extends VarHandleBaseTest {
|
||||
|
||||
{
|
||||
boolean success = false;
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET);
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, 2.0d, 1.0d);
|
||||
success = (boolean) mh.invokeExact(recv, 2.0d, 1.0d);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet double");
|
||||
double x = (double) hs.get(TestAccessMode.GET).invokeExact(recv);
|
||||
@ -414,9 +423,11 @@ public class VarHandleTestMethodHandleAccessDouble extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(1.0d, 2.0d);
|
||||
success = (boolean) mh.invokeExact(1.0d, 2.0d);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain double");
|
||||
double x = (double) hs.get(TestAccessMode.GET).invokeExact();
|
||||
@ -431,9 +442,11 @@ public class VarHandleTestMethodHandleAccessDouble extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(2.0d, 1.0d);
|
||||
success = (boolean) mh.invokeExact(2.0d, 1.0d);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire double");
|
||||
double x = (double) hs.get(TestAccessMode.GET).invokeExact();
|
||||
@ -441,16 +454,19 @@ public class VarHandleTestMethodHandleAccessDouble extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
boolean success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(2.0d, 3.0d);
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE);
|
||||
boolean success = (boolean) mh.invokeExact(2.0d, 3.0d);
|
||||
assertEquals(success, false, "failing weakCompareAndSetAcquire double");
|
||||
double x = (double) hs.get(TestAccessMode.GET).invokeExact();
|
||||
assertEquals(x, 1.0d, "failing weakCompareAndSetAcquire double value");
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(1.0d, 2.0d);
|
||||
success = (boolean) mh.invokeExact(1.0d, 2.0d);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease double");
|
||||
double x = (double) hs.get(TestAccessMode.GET).invokeExact();
|
||||
@ -465,9 +481,11 @@ public class VarHandleTestMethodHandleAccessDouble extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(2.0d, 1.0d);
|
||||
success = (boolean) mh.invokeExact(2.0d, 1.0d);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet double");
|
||||
double x = (double) hs.get(TestAccessMode.GET).invokeExact();
|
||||
@ -645,9 +663,11 @@ public class VarHandleTestMethodHandleAccessDouble extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(array, i, 1.0d, 2.0d);
|
||||
success = (boolean) mh.invokeExact(array, i, 1.0d, 2.0d);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain double");
|
||||
double x = (double) hs.get(TestAccessMode.GET).invokeExact(array, i);
|
||||
@ -662,9 +682,11 @@ public class VarHandleTestMethodHandleAccessDouble extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(array, i, 2.0d, 1.0d);
|
||||
success = (boolean) mh.invokeExact(array, i, 2.0d, 1.0d);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire double");
|
||||
double x = (double) hs.get(TestAccessMode.GET).invokeExact(array, i);
|
||||
@ -679,9 +701,11 @@ public class VarHandleTestMethodHandleAccessDouble extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(array, i, 1.0d, 2.0d);
|
||||
success = (boolean) mh.invokeExact(array, i, 1.0d, 2.0d);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease double");
|
||||
double x = (double) hs.get(TestAccessMode.GET).invokeExact(array, i);
|
||||
@ -696,9 +720,11 @@ public class VarHandleTestMethodHandleAccessDouble extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, 2.0d, 1.0d);
|
||||
success = (boolean) mh.invokeExact(array, i, 2.0d, 1.0d);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet double");
|
||||
double x = (double) hs.get(TestAccessMode.GET).invokeExact(array, i);
|
||||
|
@ -30,6 +30,7 @@ import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import java.lang.invoke.MethodHandle;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
import java.util.ArrayList;
|
||||
@ -208,9 +209,11 @@ public class VarHandleTestMethodHandleAccessFloat extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(recv, 1.0f, 2.0f);
|
||||
success = (boolean) mh.invokeExact(recv, 1.0f, 2.0f);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain float");
|
||||
float x = (float) hs.get(TestAccessMode.GET).invokeExact(recv);
|
||||
@ -225,9 +228,11 @@ public class VarHandleTestMethodHandleAccessFloat extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(recv, 2.0f, 1.0f);
|
||||
success = (boolean) mh.invokeExact(recv, 2.0f, 1.0f);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire float");
|
||||
float x = (float) hs.get(TestAccessMode.GET).invokeExact(recv);
|
||||
@ -242,9 +247,11 @@ public class VarHandleTestMethodHandleAccessFloat extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(recv, 1.0f, 2.0f);
|
||||
success = (boolean) mh.invokeExact(recv, 1.0f, 2.0f);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease float");
|
||||
float x = (float) hs.get(TestAccessMode.GET).invokeExact(recv);
|
||||
@ -260,8 +267,10 @@ public class VarHandleTestMethodHandleAccessFloat extends VarHandleBaseTest {
|
||||
|
||||
{
|
||||
boolean success = false;
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET);
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, 2.0f, 1.0f);
|
||||
success = (boolean) mh.invokeExact(recv, 2.0f, 1.0f);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet float");
|
||||
float x = (float) hs.get(TestAccessMode.GET).invokeExact(recv);
|
||||
@ -414,9 +423,11 @@ public class VarHandleTestMethodHandleAccessFloat extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(1.0f, 2.0f);
|
||||
success = (boolean) mh.invokeExact(1.0f, 2.0f);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain float");
|
||||
float x = (float) hs.get(TestAccessMode.GET).invokeExact();
|
||||
@ -431,9 +442,11 @@ public class VarHandleTestMethodHandleAccessFloat extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(2.0f, 1.0f);
|
||||
success = (boolean) mh.invokeExact(2.0f, 1.0f);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire float");
|
||||
float x = (float) hs.get(TestAccessMode.GET).invokeExact();
|
||||
@ -441,16 +454,19 @@ public class VarHandleTestMethodHandleAccessFloat extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
boolean success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(2.0f, 3.0f);
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE);
|
||||
boolean success = (boolean) mh.invokeExact(2.0f, 3.0f);
|
||||
assertEquals(success, false, "failing weakCompareAndSetAcquire float");
|
||||
float x = (float) hs.get(TestAccessMode.GET).invokeExact();
|
||||
assertEquals(x, 1.0f, "failing weakCompareAndSetAcquire float value");
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(1.0f, 2.0f);
|
||||
success = (boolean) mh.invokeExact(1.0f, 2.0f);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease float");
|
||||
float x = (float) hs.get(TestAccessMode.GET).invokeExact();
|
||||
@ -465,9 +481,11 @@ public class VarHandleTestMethodHandleAccessFloat extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(2.0f, 1.0f);
|
||||
success = (boolean) mh.invokeExact(2.0f, 1.0f);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet float");
|
||||
float x = (float) hs.get(TestAccessMode.GET).invokeExact();
|
||||
@ -645,9 +663,11 @@ public class VarHandleTestMethodHandleAccessFloat extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(array, i, 1.0f, 2.0f);
|
||||
success = (boolean) mh.invokeExact(array, i, 1.0f, 2.0f);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain float");
|
||||
float x = (float) hs.get(TestAccessMode.GET).invokeExact(array, i);
|
||||
@ -662,9 +682,11 @@ public class VarHandleTestMethodHandleAccessFloat extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(array, i, 2.0f, 1.0f);
|
||||
success = (boolean) mh.invokeExact(array, i, 2.0f, 1.0f);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire float");
|
||||
float x = (float) hs.get(TestAccessMode.GET).invokeExact(array, i);
|
||||
@ -679,9 +701,11 @@ public class VarHandleTestMethodHandleAccessFloat extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(array, i, 1.0f, 2.0f);
|
||||
success = (boolean) mh.invokeExact(array, i, 1.0f, 2.0f);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease float");
|
||||
float x = (float) hs.get(TestAccessMode.GET).invokeExact(array, i);
|
||||
@ -696,9 +720,11 @@ public class VarHandleTestMethodHandleAccessFloat extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, 2.0f, 1.0f);
|
||||
success = (boolean) mh.invokeExact(array, i, 2.0f, 1.0f);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet float");
|
||||
float x = (float) hs.get(TestAccessMode.GET).invokeExact(array, i);
|
||||
|
@ -30,6 +30,7 @@ import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import java.lang.invoke.MethodHandle;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
import java.util.ArrayList;
|
||||
@ -208,9 +209,11 @@ public class VarHandleTestMethodHandleAccessInt extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(recv, 0x01234567, 0x89ABCDEF);
|
||||
success = (boolean) mh.invokeExact(recv, 0x01234567, 0x89ABCDEF);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain int");
|
||||
int x = (int) hs.get(TestAccessMode.GET).invokeExact(recv);
|
||||
@ -225,9 +228,11 @@ public class VarHandleTestMethodHandleAccessInt extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(recv, 0x89ABCDEF, 0x01234567);
|
||||
success = (boolean) mh.invokeExact(recv, 0x89ABCDEF, 0x01234567);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire int");
|
||||
int x = (int) hs.get(TestAccessMode.GET).invokeExact(recv);
|
||||
@ -242,9 +247,11 @@ public class VarHandleTestMethodHandleAccessInt extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(recv, 0x01234567, 0x89ABCDEF);
|
||||
success = (boolean) mh.invokeExact(recv, 0x01234567, 0x89ABCDEF);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease int");
|
||||
int x = (int) hs.get(TestAccessMode.GET).invokeExact(recv);
|
||||
@ -260,8 +267,10 @@ public class VarHandleTestMethodHandleAccessInt extends VarHandleBaseTest {
|
||||
|
||||
{
|
||||
boolean success = false;
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET);
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, 0x89ABCDEF, 0x01234567);
|
||||
success = (boolean) mh.invokeExact(recv, 0x89ABCDEF, 0x01234567);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet int");
|
||||
int x = (int) hs.get(TestAccessMode.GET).invokeExact(recv);
|
||||
@ -492,9 +501,11 @@ public class VarHandleTestMethodHandleAccessInt extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(0x01234567, 0x89ABCDEF);
|
||||
success = (boolean) mh.invokeExact(0x01234567, 0x89ABCDEF);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain int");
|
||||
int x = (int) hs.get(TestAccessMode.GET).invokeExact();
|
||||
@ -509,9 +520,11 @@ public class VarHandleTestMethodHandleAccessInt extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(0x89ABCDEF, 0x01234567);
|
||||
success = (boolean) mh.invokeExact(0x89ABCDEF, 0x01234567);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire int");
|
||||
int x = (int) hs.get(TestAccessMode.GET).invokeExact();
|
||||
@ -519,16 +532,19 @@ public class VarHandleTestMethodHandleAccessInt extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
boolean success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(0x89ABCDEF, 0xCAFEBABE);
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE);
|
||||
boolean success = (boolean) mh.invokeExact(0x89ABCDEF, 0xCAFEBABE);
|
||||
assertEquals(success, false, "failing weakCompareAndSetAcquire int");
|
||||
int x = (int) hs.get(TestAccessMode.GET).invokeExact();
|
||||
assertEquals(x, 0x01234567, "failing weakCompareAndSetAcquire int value");
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(0x01234567, 0x89ABCDEF);
|
||||
success = (boolean) mh.invokeExact(0x01234567, 0x89ABCDEF);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease int");
|
||||
int x = (int) hs.get(TestAccessMode.GET).invokeExact();
|
||||
@ -543,9 +559,11 @@ public class VarHandleTestMethodHandleAccessInt extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(0x89ABCDEF, 0x01234567);
|
||||
success = (boolean) mh.invokeExact(0x89ABCDEF, 0x01234567);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet int");
|
||||
int x = (int) hs.get(TestAccessMode.GET).invokeExact();
|
||||
@ -801,9 +819,11 @@ public class VarHandleTestMethodHandleAccessInt extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(array, i, 0x01234567, 0x89ABCDEF);
|
||||
success = (boolean) mh.invokeExact(array, i, 0x01234567, 0x89ABCDEF);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain int");
|
||||
int x = (int) hs.get(TestAccessMode.GET).invokeExact(array, i);
|
||||
@ -818,9 +838,11 @@ public class VarHandleTestMethodHandleAccessInt extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(array, i, 0x89ABCDEF, 0x01234567);
|
||||
success = (boolean) mh.invokeExact(array, i, 0x89ABCDEF, 0x01234567);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire int");
|
||||
int x = (int) hs.get(TestAccessMode.GET).invokeExact(array, i);
|
||||
@ -835,9 +857,11 @@ public class VarHandleTestMethodHandleAccessInt extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(array, i, 0x01234567, 0x89ABCDEF);
|
||||
success = (boolean) mh.invokeExact(array, i, 0x01234567, 0x89ABCDEF);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease int");
|
||||
int x = (int) hs.get(TestAccessMode.GET).invokeExact(array, i);
|
||||
@ -852,9 +876,11 @@ public class VarHandleTestMethodHandleAccessInt extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, 0x89ABCDEF, 0x01234567);
|
||||
success = (boolean) mh.invokeExact(array, i, 0x89ABCDEF, 0x01234567);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet int");
|
||||
int x = (int) hs.get(TestAccessMode.GET).invokeExact(array, i);
|
||||
|
@ -30,6 +30,7 @@ import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import java.lang.invoke.MethodHandle;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
import java.util.ArrayList;
|
||||
@ -208,9 +209,11 @@ public class VarHandleTestMethodHandleAccessLong extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(recv, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
|
||||
success = (boolean) mh.invokeExact(recv, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain long");
|
||||
long x = (long) hs.get(TestAccessMode.GET).invokeExact(recv);
|
||||
@ -225,9 +228,11 @@ public class VarHandleTestMethodHandleAccessLong extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(recv, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
|
||||
success = (boolean) mh.invokeExact(recv, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire long");
|
||||
long x = (long) hs.get(TestAccessMode.GET).invokeExact(recv);
|
||||
@ -242,9 +247,11 @@ public class VarHandleTestMethodHandleAccessLong extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(recv, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
|
||||
success = (boolean) mh.invokeExact(recv, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease long");
|
||||
long x = (long) hs.get(TestAccessMode.GET).invokeExact(recv);
|
||||
@ -260,8 +267,10 @@ public class VarHandleTestMethodHandleAccessLong extends VarHandleBaseTest {
|
||||
|
||||
{
|
||||
boolean success = false;
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET);
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
|
||||
success = (boolean) mh.invokeExact(recv, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet long");
|
||||
long x = (long) hs.get(TestAccessMode.GET).invokeExact(recv);
|
||||
@ -492,9 +501,11 @@ public class VarHandleTestMethodHandleAccessLong extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
|
||||
success = (boolean) mh.invokeExact(0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain long");
|
||||
long x = (long) hs.get(TestAccessMode.GET).invokeExact();
|
||||
@ -509,9 +520,11 @@ public class VarHandleTestMethodHandleAccessLong extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
|
||||
success = (boolean) mh.invokeExact(0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire long");
|
||||
long x = (long) hs.get(TestAccessMode.GET).invokeExact();
|
||||
@ -519,16 +532,19 @@ public class VarHandleTestMethodHandleAccessLong extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
boolean success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(0xCAFEBABECAFEBABEL, 0xDEADBEEFDEADBEEFL);
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE);
|
||||
boolean success = (boolean) mh.invokeExact(0xCAFEBABECAFEBABEL, 0xDEADBEEFDEADBEEFL);
|
||||
assertEquals(success, false, "failing weakCompareAndSetAcquire long");
|
||||
long x = (long) hs.get(TestAccessMode.GET).invokeExact();
|
||||
assertEquals(x, 0x0123456789ABCDEFL, "failing weakCompareAndSetAcquire long value");
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
|
||||
success = (boolean) mh.invokeExact(0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease long");
|
||||
long x = (long) hs.get(TestAccessMode.GET).invokeExact();
|
||||
@ -543,9 +559,11 @@ public class VarHandleTestMethodHandleAccessLong extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
|
||||
success = (boolean) mh.invokeExact(0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet long");
|
||||
long x = (long) hs.get(TestAccessMode.GET).invokeExact();
|
||||
@ -801,9 +819,11 @@ public class VarHandleTestMethodHandleAccessLong extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(array, i, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
|
||||
success = (boolean) mh.invokeExact(array, i, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain long");
|
||||
long x = (long) hs.get(TestAccessMode.GET).invokeExact(array, i);
|
||||
@ -818,9 +838,11 @@ public class VarHandleTestMethodHandleAccessLong extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(array, i, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
|
||||
success = (boolean) mh.invokeExact(array, i, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire long");
|
||||
long x = (long) hs.get(TestAccessMode.GET).invokeExact(array, i);
|
||||
@ -835,9 +857,11 @@ public class VarHandleTestMethodHandleAccessLong extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(array, i, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
|
||||
success = (boolean) mh.invokeExact(array, i, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease long");
|
||||
long x = (long) hs.get(TestAccessMode.GET).invokeExact(array, i);
|
||||
@ -852,9 +876,11 @@ public class VarHandleTestMethodHandleAccessLong extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
|
||||
success = (boolean) mh.invokeExact(array, i, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet long");
|
||||
long x = (long) hs.get(TestAccessMode.GET).invokeExact(array, i);
|
||||
|
@ -30,6 +30,7 @@ import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import java.lang.invoke.MethodHandle;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
import java.util.ArrayList;
|
||||
@ -208,9 +209,11 @@ public class VarHandleTestMethodHandleAccessShort extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(recv, (short)0x0123, (short)0x4567);
|
||||
success = (boolean) mh.invokeExact(recv, (short)0x0123, (short)0x4567);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain short");
|
||||
short x = (short) hs.get(TestAccessMode.GET).invokeExact(recv);
|
||||
@ -225,9 +228,11 @@ public class VarHandleTestMethodHandleAccessShort extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(recv, (short)0x4567, (short)0x0123);
|
||||
success = (boolean) mh.invokeExact(recv, (short)0x4567, (short)0x0123);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire short");
|
||||
short x = (short) hs.get(TestAccessMode.GET).invokeExact(recv);
|
||||
@ -242,9 +247,11 @@ public class VarHandleTestMethodHandleAccessShort extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(recv, (short)0x0123, (short)0x4567);
|
||||
success = (boolean) mh.invokeExact(recv, (short)0x0123, (short)0x4567);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease short");
|
||||
short x = (short) hs.get(TestAccessMode.GET).invokeExact(recv);
|
||||
@ -260,8 +267,10 @@ public class VarHandleTestMethodHandleAccessShort extends VarHandleBaseTest {
|
||||
|
||||
{
|
||||
boolean success = false;
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET);
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, (short)0x4567, (short)0x0123);
|
||||
success = (boolean) mh.invokeExact(recv, (short)0x4567, (short)0x0123);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet short");
|
||||
short x = (short) hs.get(TestAccessMode.GET).invokeExact(recv);
|
||||
@ -492,9 +501,11 @@ public class VarHandleTestMethodHandleAccessShort extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact((short)0x0123, (short)0x4567);
|
||||
success = (boolean) mh.invokeExact((short)0x0123, (short)0x4567);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain short");
|
||||
short x = (short) hs.get(TestAccessMode.GET).invokeExact();
|
||||
@ -509,9 +520,11 @@ public class VarHandleTestMethodHandleAccessShort extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact((short)0x4567, (short)0x0123);
|
||||
success = (boolean) mh.invokeExact((short)0x4567, (short)0x0123);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire short");
|
||||
short x = (short) hs.get(TestAccessMode.GET).invokeExact();
|
||||
@ -519,16 +532,19 @@ public class VarHandleTestMethodHandleAccessShort extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
boolean success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact((short)0x4567, (short)0x89AB);
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE);
|
||||
boolean success = (boolean) mh.invokeExact((short)0x4567, (short)0x89AB);
|
||||
assertEquals(success, false, "failing weakCompareAndSetAcquire short");
|
||||
short x = (short) hs.get(TestAccessMode.GET).invokeExact();
|
||||
assertEquals(x, (short)0x0123, "failing weakCompareAndSetAcquire short value");
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact((short)0x0123, (short)0x4567);
|
||||
success = (boolean) mh.invokeExact((short)0x0123, (short)0x4567);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease short");
|
||||
short x = (short) hs.get(TestAccessMode.GET).invokeExact();
|
||||
@ -543,9 +559,11 @@ public class VarHandleTestMethodHandleAccessShort extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact((short)0x4567, (short)0x0123);
|
||||
success = (boolean) mh.invokeExact((short)0x4567, (short)0x0123);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet short");
|
||||
short x = (short) hs.get(TestAccessMode.GET).invokeExact();
|
||||
@ -801,9 +819,11 @@ public class VarHandleTestMethodHandleAccessShort extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(array, i, (short)0x0123, (short)0x4567);
|
||||
success = (boolean) mh.invokeExact(array, i, (short)0x0123, (short)0x4567);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain short");
|
||||
short x = (short) hs.get(TestAccessMode.GET).invokeExact(array, i);
|
||||
@ -818,9 +838,11 @@ public class VarHandleTestMethodHandleAccessShort extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(array, i, (short)0x4567, (short)0x0123);
|
||||
success = (boolean) mh.invokeExact(array, i, (short)0x4567, (short)0x0123);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire short");
|
||||
short x = (short) hs.get(TestAccessMode.GET).invokeExact(array, i);
|
||||
@ -835,9 +857,11 @@ public class VarHandleTestMethodHandleAccessShort extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(array, i, (short)0x0123, (short)0x4567);
|
||||
success = (boolean) mh.invokeExact(array, i, (short)0x0123, (short)0x4567);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease short");
|
||||
short x = (short) hs.get(TestAccessMode.GET).invokeExact(array, i);
|
||||
@ -852,9 +876,11 @@ public class VarHandleTestMethodHandleAccessShort extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, (short)0x4567, (short)0x0123);
|
||||
success = (boolean) mh.invokeExact(array, i, (short)0x4567, (short)0x0123);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet short");
|
||||
short x = (short) hs.get(TestAccessMode.GET).invokeExact(array, i);
|
||||
|
@ -30,6 +30,7 @@ import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import java.lang.invoke.MethodHandle;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
import java.util.ArrayList;
|
||||
@ -208,9 +209,11 @@ public class VarHandleTestMethodHandleAccessString extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(recv, "foo", "bar");
|
||||
success = (boolean) mh.invokeExact(recv, "foo", "bar");
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain String");
|
||||
String x = (String) hs.get(TestAccessMode.GET).invokeExact(recv);
|
||||
@ -225,9 +228,11 @@ public class VarHandleTestMethodHandleAccessString extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(recv, "bar", "foo");
|
||||
success = (boolean) mh.invokeExact(recv, "bar", "foo");
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire String");
|
||||
String x = (String) hs.get(TestAccessMode.GET).invokeExact(recv);
|
||||
@ -242,9 +247,11 @@ public class VarHandleTestMethodHandleAccessString extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(recv, "foo", "bar");
|
||||
success = (boolean) mh.invokeExact(recv, "foo", "bar");
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease String");
|
||||
String x = (String) hs.get(TestAccessMode.GET).invokeExact(recv);
|
||||
@ -260,8 +267,10 @@ public class VarHandleTestMethodHandleAccessString extends VarHandleBaseTest {
|
||||
|
||||
{
|
||||
boolean success = false;
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET);
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, "bar", "foo");
|
||||
success = (boolean) mh.invokeExact(recv, "bar", "foo");
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet String");
|
||||
String x = (String) hs.get(TestAccessMode.GET).invokeExact(recv);
|
||||
@ -392,9 +401,11 @@ public class VarHandleTestMethodHandleAccessString extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact("foo", "bar");
|
||||
success = (boolean) mh.invokeExact("foo", "bar");
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain String");
|
||||
String x = (String) hs.get(TestAccessMode.GET).invokeExact();
|
||||
@ -409,9 +420,11 @@ public class VarHandleTestMethodHandleAccessString extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact("bar", "foo");
|
||||
success = (boolean) mh.invokeExact("bar", "foo");
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire String");
|
||||
String x = (String) hs.get(TestAccessMode.GET).invokeExact();
|
||||
@ -419,16 +432,19 @@ public class VarHandleTestMethodHandleAccessString extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
boolean success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact("bar", "baz");
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE);
|
||||
boolean success = (boolean) mh.invokeExact("bar", "baz");
|
||||
assertEquals(success, false, "failing weakCompareAndSetAcquire String");
|
||||
String x = (String) hs.get(TestAccessMode.GET).invokeExact();
|
||||
assertEquals(x, "foo", "failing weakCompareAndSetAcquire String value");
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact("foo", "bar");
|
||||
success = (boolean) mh.invokeExact("foo", "bar");
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease String");
|
||||
String x = (String) hs.get(TestAccessMode.GET).invokeExact();
|
||||
@ -443,9 +459,11 @@ public class VarHandleTestMethodHandleAccessString extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact("bar", "foo");
|
||||
success = (boolean) mh.invokeExact("bar", "foo");
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet String");
|
||||
String x = (String) hs.get(TestAccessMode.GET).invokeExact();
|
||||
@ -601,9 +619,11 @@ public class VarHandleTestMethodHandleAccessString extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(array, i, "foo", "bar");
|
||||
success = (boolean) mh.invokeExact(array, i, "foo", "bar");
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain String");
|
||||
String x = (String) hs.get(TestAccessMode.GET).invokeExact(array, i);
|
||||
@ -618,9 +638,11 @@ public class VarHandleTestMethodHandleAccessString extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(array, i, "bar", "foo");
|
||||
success = (boolean) mh.invokeExact(array, i, "bar", "foo");
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire String");
|
||||
String x = (String) hs.get(TestAccessMode.GET).invokeExact(array, i);
|
||||
@ -635,9 +657,11 @@ public class VarHandleTestMethodHandleAccessString extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(array, i, "foo", "bar");
|
||||
success = (boolean) mh.invokeExact(array, i, "foo", "bar");
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease String");
|
||||
String x = (String) hs.get(TestAccessMode.GET).invokeExact(array, i);
|
||||
@ -652,9 +676,11 @@ public class VarHandleTestMethodHandleAccessString extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, "bar", "foo");
|
||||
success = (boolean) mh.invokeExact(array, i, "bar", "foo");
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet String");
|
||||
String x = (String) hs.get(TestAccessMode.GET).invokeExact(array, i);
|
||||
|
@ -725,6 +725,7 @@ public class VarHandleTestAccess$Type$ extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetPlain(recv, $value1$, $value2$);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain $type$");
|
||||
$type$ x = ($type$) vh.get(recv);
|
||||
@ -742,6 +743,7 @@ public class VarHandleTestAccess$Type$ extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetAcquire(recv, $value2$, $value1$);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire $type$");
|
||||
$type$ x = ($type$) vh.get(recv);
|
||||
@ -759,6 +761,7 @@ public class VarHandleTestAccess$Type$ extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetRelease(recv, $value1$, $value2$);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease $type$");
|
||||
$type$ x = ($type$) vh.get(recv);
|
||||
@ -776,6 +779,7 @@ public class VarHandleTestAccess$Type$ extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSet(recv, $value2$, $value1$);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet $type$");
|
||||
$type$ x = ($type$) vh.get(recv);
|
||||
@ -1130,6 +1134,7 @@ public class VarHandleTestAccess$Type$ extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetPlain($value1$, $value2$);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain $type$");
|
||||
$type$ x = ($type$) vh.get();
|
||||
@ -1147,6 +1152,7 @@ public class VarHandleTestAccess$Type$ extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetAcquire($value2$, $value1$);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire $type$");
|
||||
$type$ x = ($type$) vh.get();
|
||||
@ -1164,6 +1170,7 @@ public class VarHandleTestAccess$Type$ extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetRelease($value1$, $value2$);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease $type$");
|
||||
$type$ x = ($type$) vh.get();
|
||||
@ -1181,6 +1188,7 @@ public class VarHandleTestAccess$Type$ extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSet($value2$, $value1$);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet $type$");
|
||||
$type$ x = ($type$) vh.get();
|
||||
@ -1538,6 +1546,7 @@ public class VarHandleTestAccess$Type$ extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetPlain(array, i, $value1$, $value2$);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain $type$");
|
||||
$type$ x = ($type$) vh.get(array, i);
|
||||
@ -1555,6 +1564,7 @@ public class VarHandleTestAccess$Type$ extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetAcquire(array, i, $value2$, $value1$);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire $type$");
|
||||
$type$ x = ($type$) vh.get(array, i);
|
||||
@ -1572,6 +1582,7 @@ public class VarHandleTestAccess$Type$ extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetRelease(array, i, $value1$, $value2$);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease $type$");
|
||||
$type$ x = ($type$) vh.get(array, i);
|
||||
@ -1589,6 +1600,7 @@ public class VarHandleTestAccess$Type$ extends VarHandleBaseTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSet(array, i, $value2$, $value1$);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet $type$");
|
||||
$type$ x = ($type$) vh.get(array, i);
|
||||
|
@ -1626,6 +1626,7 @@ public class VarHandleTestByteArrayAs$Type$ extends VarHandleBaseByteArrayTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetPlain(array, i, VALUE_1, VALUE_2);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain $type$");
|
||||
$type$ x = ($type$) vh.get(array, i);
|
||||
@ -1643,6 +1644,7 @@ public class VarHandleTestByteArrayAs$Type$ extends VarHandleBaseByteArrayTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetAcquire(array, i, VALUE_2, VALUE_1);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire $type$");
|
||||
$type$ x = ($type$) vh.get(array, i);
|
||||
@ -1660,6 +1662,7 @@ public class VarHandleTestByteArrayAs$Type$ extends VarHandleBaseByteArrayTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetRelease(array, i, VALUE_1, VALUE_2);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease $type$");
|
||||
$type$ x = ($type$) vh.get(array, i);
|
||||
@ -1677,6 +1680,7 @@ public class VarHandleTestByteArrayAs$Type$ extends VarHandleBaseByteArrayTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSet(array, i, VALUE_2, VALUE_1);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet $type$");
|
||||
$type$ x = ($type$) vh.get(array, i);
|
||||
@ -1943,6 +1947,7 @@ public class VarHandleTestByteArrayAs$Type$ extends VarHandleBaseByteArrayTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetPlain(array, i, VALUE_1, VALUE_2);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain $type$");
|
||||
$type$ x = ($type$) vh.get(array, i);
|
||||
@ -1960,6 +1965,7 @@ public class VarHandleTestByteArrayAs$Type$ extends VarHandleBaseByteArrayTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetAcquire(array, i, VALUE_2, VALUE_1);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire $type$");
|
||||
$type$ x = ($type$) vh.get(array, i);
|
||||
@ -1977,6 +1983,7 @@ public class VarHandleTestByteArrayAs$Type$ extends VarHandleBaseByteArrayTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSetRelease(array, i, VALUE_1, VALUE_2);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease $type$");
|
||||
$type$ x = ($type$) vh.get(array, i);
|
||||
@ -1994,6 +2001,7 @@ public class VarHandleTestByteArrayAs$Type$ extends VarHandleBaseByteArrayTest {
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = vh.weakCompareAndSet(array, i, VALUE_2, VALUE_1);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet $type$");
|
||||
$type$ x = ($type$) vh.get(array, i);
|
||||
|
@ -30,6 +30,7 @@ import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import java.lang.invoke.MethodHandle;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
import java.util.ArrayList;
|
||||
@ -209,9 +210,11 @@ public class VarHandleTestMethodHandleAccess$Type$ extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(recv, $value1$, $value2$);
|
||||
success = (boolean) mh.invokeExact(recv, $value1$, $value2$);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain $type$");
|
||||
$type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(recv);
|
||||
@ -226,9 +229,11 @@ public class VarHandleTestMethodHandleAccess$Type$ extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(recv, $value2$, $value1$);
|
||||
success = (boolean) mh.invokeExact(recv, $value2$, $value1$);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire $type$");
|
||||
$type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(recv);
|
||||
@ -243,9 +248,11 @@ public class VarHandleTestMethodHandleAccess$Type$ extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(recv, $value1$, $value2$);
|
||||
success = (boolean) mh.invokeExact(recv, $value1$, $value2$);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease $type$");
|
||||
$type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(recv);
|
||||
@ -261,8 +268,10 @@ public class VarHandleTestMethodHandleAccess$Type$ extends VarHandleBaseTest {
|
||||
|
||||
{
|
||||
boolean success = false;
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET);
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, $value2$, $value1$);
|
||||
success = (boolean) mh.invokeExact(recv, $value2$, $value1$);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet $type$");
|
||||
$type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(recv);
|
||||
@ -532,9 +541,11 @@ public class VarHandleTestMethodHandleAccess$Type$ extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact($value1$, $value2$);
|
||||
success = (boolean) mh.invokeExact($value1$, $value2$);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain $type$");
|
||||
$type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact();
|
||||
@ -549,9 +560,11 @@ public class VarHandleTestMethodHandleAccess$Type$ extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact($value2$, $value1$);
|
||||
success = (boolean) mh.invokeExact($value2$, $value1$);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire $type$");
|
||||
$type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact();
|
||||
@ -559,16 +572,19 @@ public class VarHandleTestMethodHandleAccess$Type$ extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
boolean success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact($value2$, $value3$);
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE);
|
||||
boolean success = (boolean) mh.invokeExact($value2$, $value3$);
|
||||
assertEquals(success, false, "failing weakCompareAndSetAcquire $type$");
|
||||
$type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact();
|
||||
assertEquals(x, $value1$, "failing weakCompareAndSetAcquire $type$ value");
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact($value1$, $value2$);
|
||||
success = (boolean) mh.invokeExact($value1$, $value2$);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease $type$");
|
||||
$type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact();
|
||||
@ -583,9 +599,11 @@ public class VarHandleTestMethodHandleAccess$Type$ extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact($value2$, $value1$);
|
||||
success = (boolean) mh.invokeExact($value2$, $value1$);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet $type$");
|
||||
$type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact();
|
||||
@ -880,9 +898,11 @@ public class VarHandleTestMethodHandleAccess$Type$ extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(array, i, $value1$, $value2$);
|
||||
success = (boolean) mh.invokeExact(array, i, $value1$, $value2$);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetPlain $type$");
|
||||
$type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(array, i);
|
||||
@ -897,9 +917,11 @@ public class VarHandleTestMethodHandleAccess$Type$ extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(array, i, $value2$, $value1$);
|
||||
success = (boolean) mh.invokeExact(array, i, $value2$, $value1$);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetAcquire $type$");
|
||||
$type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(array, i);
|
||||
@ -914,9 +936,11 @@ public class VarHandleTestMethodHandleAccess$Type$ extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(array, i, $value1$, $value2$);
|
||||
success = (boolean) mh.invokeExact(array, i, $value1$, $value2$);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSetRelease $type$");
|
||||
$type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(array, i);
|
||||
@ -931,9 +955,11 @@ public class VarHandleTestMethodHandleAccess$Type$ extends VarHandleBaseTest {
|
||||
}
|
||||
|
||||
{
|
||||
MethodHandle mh = hs.get(TestAccessMode.WEAK_COMPARE_AND_SET);
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, $value2$, $value1$);
|
||||
success = (boolean) mh.invokeExact(array, i, $value2$, $value1$);
|
||||
if (!success) weakDelay();
|
||||
}
|
||||
assertEquals(success, true, "success weakCompareAndSet $type$");
|
||||
$type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(array, i);
|
||||
|
Loading…
Reference in New Issue
Block a user