@Override default long readVolatileLong(S handle, long offset) { return handle.readVolatileLong(offset); }
@Override default long readVolatileLong(S handle, long offset) { return handle.readVolatileLong(offset); }
/** * Read a 64-bit double from memory with a load barrier. * * @param offset to read * @return the double value * @throws BufferUnderflowException if the offset is outside the limits of the Bytes */ default double readVolatileDouble(long offset) throws BufferUnderflowException { return Double.longBitsToDouble(readVolatileLong(offset)); }
public static double addAndGetDouble(@org.jetbrains.annotations.NotNull @NotNull RandomDataInput in, long offset, double adding) throws BufferUnderflowException { try { for (; ; ) { long value = in.readVolatileLong(offset); double value1 = Double.longBitsToDouble(value) + adding; long value2 = Double.doubleToRawLongBits(value1); if (in.compareAndSwapLong(offset, value, value2)) return value1; } } catch (BufferOverflowException e) { throw new AssertionError(e); } }
public static long addAndGetLong(@org.jetbrains.annotations.NotNull @NotNull RandomDataInput in, long offset, long adding) throws BufferUnderflowException { try { for (; ; ) { long value = in.readVolatileLong(offset); long value2 = value + adding; if (in.compareAndSwapLong(offset, value, value2)) return value2; } } catch (BufferOverflowException e) { throw new AssertionError(e); } }