This class may be removed in the future. Consider the replacements in JEP 193 'Variable Handles': http://openjdk.java.net/jeps/193
@Override public long getLongVolatile(long byteIndex) { return unsafe.getLongVolatile(null, baseAdress + byteIndex); }
@Override public long getLongVolatile(long byteIndex) { return unsafe.getLongVolatile(base, off + byteIndex); }
public static long getLongVolatile( Object obj, long offset ) { return unsafe.getLongVolatile( obj, offset ); }
/** * Get the latest value for the counter with volatile semantics. * <p> * <b>Note:</b>The user should call {@link #isClosed()} and ensure the result is false to avoid a race on reading * a closed counter. * * @return the latest value for the counter. */ public long get() { return UnsafeAccess.UNSAFE.getLongVolatile(buffer, addressOffset); }
/** * Get the raw current tail value in a volatile memory ordering fashion. * * @return the current tail value. */ public long rawTailVolatile() { return UnsafeAccess.UNSAFE.getLongVolatile(null, tailAddressOffset); }
private long lvConsumerIndex() { return UNSAFE.getLongVolatile(this, C_INDEX_OFFSET); }
private long lvProducerIndex() { return UNSAFE.getLongVolatile(this, P_INDEX_OFFSET); }
/** * Gets long value with volatile semantic. * * @param obj Object. * @param off Offset. * @return Long value. */ public static long getLongVolatile(Object obj, long off) { return UNSAFE.getLongVolatile(obj, off); }
@Override public final long lvConsumerIndex() { return UNSAFE.getLongVolatile(this, C_INDEX_OFFSET); }
@Override public final long lvProducerIndex() { return UNSAFE.getLongVolatile(this, P_INDEX_OFFSET); }
public long getVolatile() { return UnsafeAccess.UNSAFE.getLongVolatile(byteArray, addressOffset); } }
public final long lvConsumerIndex() { return UNSAFE.getLongVolatile(this, C_INDEX_OFFSET); }
protected final long lvSequence(long[] buffer, long offset) { return UNSAFE.getLongVolatile(buffer, offset); }
protected final long lvProducerLimit() { return UNSAFE.getLongVolatile(this, P_LIMIT_OFFSET); }
@Override protected void inc(long[] cells, long offset, long delta) { long v; do { v = UNSAFE.getLongVolatile(cells, offset); } while (!UNSAFE.compareAndSwapLong(cells, offset, v, v + delta)); }
@Override protected long getAndReset(long[] cells, long offset) { long v; do { v = UNSAFE.getLongVolatile(cells, offset); } while (!UNSAFE.compareAndSwapLong(cells, offset, v, 0L)); return v; } }
@Override public boolean contains(Object needle) { while (true) { long mc = UNSAFE.getLongVolatile(this, MC_OFFSET); boolean result = containsImpl(needle); long newMc = UNSAFE.getLongVolatile(this, MC_OFFSET); if ((newMc & 1) == 0 && mc == newMc) { return result; } } }
public static long getLongVolatile( long address ) { checkAccess( address, Long.BYTES ); return unsafe.getLongVolatile( null, address ); }
@Override public long get() { long result = 0L; long[] cells = this.cells; int length = mask + 1; for (int i = 0; i < length; i++) { result += UNSAFE.getLongVolatile(cells, counterOffset(i)); } return result; }
public long getLongVolatile(final long index) { if (SHOULD_BOUNDS_CHECK) { boundsCheck0(index, SIZE_OF_LONG); } return UNSAFE.getLongVolatile(null, addressOffset + index); }