mirror of
https://github.com/openjdk/jdk.git
synced 2026-07-28 11:53:09 +00:00
8160885: Unsafe.compareAndExchangeDouble/FloatAcquire should defer to compareAndExchangeLong/IntAcquire
Reviewed-by: mhaupt
This commit is contained in:
parent
748aad61f6
commit
a4245ceb1d
@ -1709,9 +1709,9 @@ public final class Unsafe {
|
||||
public final float compareAndExchangeFloatAcquire(Object o, long offset,
|
||||
float expected,
|
||||
float x) {
|
||||
int w = compareAndExchangeIntVolatile(o, offset,
|
||||
Float.floatToRawIntBits(expected),
|
||||
Float.floatToRawIntBits(x));
|
||||
int w = compareAndExchangeIntAcquire(o, offset,
|
||||
Float.floatToRawIntBits(expected),
|
||||
Float.floatToRawIntBits(x));
|
||||
return Float.intBitsToFloat(w);
|
||||
}
|
||||
|
||||
@ -1793,9 +1793,9 @@ public final class Unsafe {
|
||||
public final double compareAndExchangeDoubleAcquire(Object o, long offset,
|
||||
double expected,
|
||||
double x) {
|
||||
long w = compareAndExchangeLongVolatile(o, offset,
|
||||
Double.doubleToRawLongBits(expected),
|
||||
Double.doubleToRawLongBits(x));
|
||||
long w = compareAndExchangeLongAcquire(o, offset,
|
||||
Double.doubleToRawLongBits(expected),
|
||||
Double.doubleToRawLongBits(x));
|
||||
return Double.longBitsToDouble(w);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user