This class may be removed in the future. Consider the replacements in JEP 193 'Variable Handles': http://openjdk.java.net/jeps/193
/** * Performs a volatile write of this sequence. The intent is * a Store/Store barrier between this write and any previous * write and a Store/Load barrier between this write and any * subsequent volatile read. * * @param value The new value for the sequence. */ public void setVolatile(final long value) { UNSAFE.putLongVolatile(this, VALUE_OFFSET, value); }
@Override public void putLongVolatile(long byteIndex, long l) { unsafe.putLongVolatile(null, baseAdress + byteIndex, l); }
@Override public void putLongVolatile(long byteIndex, long l) { unsafe.putLongVolatile(base, off + byteIndex, l); }
public static void putLongVolatile( Object obj, long offset, long value ) { unsafe.putLongVolatile( obj, offset, value ); }
/** * Stores long value with volatile semantic. * * @param obj Object. * @param off Offset. * @param val Value. */ public static void putLongVolatile(Object obj, long off, long val) { UNSAFE.putLongVolatile(obj, off, val); }
/** * Set the counter with volatile semantics. * * @param value to be set with volatile semantics. */ public void set(final long value) { UnsafeAccess.UNSAFE.putLongVolatile(byteArray, addressOffset, value); }
protected final void svSequenceElement(long offset, long e) { UNSAFE.putLongVolatile(sequenceBuffer, offset, e); }
public void setVolatile(final long value) { UnsafeAccess.UNSAFE.putLongVolatile(byteArray, addressOffset, value); }
protected final void svSequenceElement(long[] buffer, long offset, long e) { UNSAFE.putLongVolatile(buffer, offset, e); }
@Override public void putLongVolatile(long byteIndex, long l) { unsafe.putLongVolatile(null, baseAdress + byteIndex, l); }
public void putLongVolatile(Object o, long offset, long v) { this.unsafe.putLongVolatile(o, offset, v); }
@Override public void putLongVolatile(long byteIndex, long l) { unsafe.putLongVolatile(base, off + byteIndex, l); }
public void putLongVolatile(Object target, long offset, long value) { unsafe.putLongVolatile(target, offset, value); }
public void putLongVolatile(Object target, long offset, long value) { unsafe.putLongVolatile(target, offset, value); }
public static void putLongVolatile( long address, long value ) { checkAccess( address, Long.BYTES ); unsafe.putLongVolatile( null, address, value ); }
/** * Sets the element at position {@code i} to the given value. * * @param i the index * @param newValue the new value */ public final void set(int i, long newValue) { unsafe.putLongVolatile(array, checkedByteOffset(i), newValue); }
public void putLongVolatile(final long index, final long value) { if (SHOULD_BOUNDS_CHECK) { boundsCheck0(index, SIZE_OF_LONG); } UNSAFE.putLongVolatile(null, addressOffset + index, value); }
public void putLongVolatile(final int index, final long value) { if (SHOULD_BOUNDS_CHECK) { boundsCheck0(index, SIZE_OF_LONG); } UNSAFE.putLongVolatile(byteArray, addressOffset + index, value); }
public void set(T obj, long newValue) { if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj); unsafe.putLongVolatile(obj, offset, newValue); }
/** * Create a new queue with a bounded capacity. The requested capacity will be rounded up to the next positive * power of two in size. That is if you request a capacity of 1000 then you will get 1024. If you request 1024 * then that is what you will get. * * @param requestedCapacity of the queue which must be >= 2. * @throws IllegalArgumentException if the requestedCapacity < 2. */ public ManyToManyConcurrentArrayQueue(final int requestedCapacity) { super(requestedCapacity); if (requestedCapacity < 2) { throw new IllegalArgumentException( "requestedCapacity must be >= 2: requestedCapacity=" + requestedCapacity); } final long[] sequences = new long[capacity]; for (int i = 0; i < capacity; i++) { sequences[i] = i; } UNSAFE.putLongVolatile(sequences, sequenceArrayOffset(0, sequences.length - 1), 0); this.sequences = sequences; }