This class may be removed in the future. Consider the replacements in JEP 193 'Variable Handles': http://openjdk.java.net/jeps/193
/** CASes the base field. */ final boolean casBase(long cmp, long val) { return UNSAFE.compareAndSwapLong(this, baseOffset, cmp, val); }
/** CASes the base field. */ final boolean casBase(long cmp, long val) { return UNSAFE.compareAndSwapLong(this, baseOffset, cmp, val); }
final boolean cas(long cmp, long val) { return UNSAFE.compareAndSwapLong(this, valueOffset, cmp, val); }
final boolean cas(long cmp, long val) { return UNSAFE.compareAndSwapLong(this, valueOffset, cmp, val); }
/** * Perform a compare and set operation on the sequence. * * @param expectedValue The expected current value. * @param newValue The value to update to. * @return true if the operation succeeds, false otherwise. */ public boolean compareAndSet(final long expectedValue, final long newValue) { return UNSAFE.compareAndSwapLong(this, VALUE_OFFSET, expectedValue, newValue); }
/** CASes the base field. */ final boolean casBase(long cmp, long val) { return UNSAFE.compareAndSwapLong(this, baseOffset, cmp, val); }
/** CASes the base field. */ final boolean casBase(long cmp, long val) { return UNSAFE.compareAndSwapLong(this, baseOffset, cmp, val); }
@Override public boolean compareAndSwapLong(long offset, long expect, long newVal) { return unsafe.compareAndSwapLong(base, off + offset, expect, newVal); }
@Override public boolean compareAndSwapLong(long offset, long expect, long newVal) { return unsafe.compareAndSwapLong(null, baseAdress + offset, expect, newVal); }
/** * Atomically compare the current value of the given long field with the expected value, and if they are the * equal, set the field to the updated value and return true. Otherwise return false. * <p> * If this method returns true, then it has the memory visibility semantics of a volatile read followed by a * volatile write. */ public static boolean compareAndSwapLong( Object obj, long offset, long expected, long update ) { return unsafe.compareAndSwapLong( obj, offset, expected, update ); }
final boolean cas(long cmp, long val) { return UNSAFE.compareAndSwapLong(this, valueOffset, cmp, val); }
final boolean cas(long cmp, long val) { return UNSAFE.compareAndSwapLong(this, valueOffset, cmp, val); }
/** * CASes the base field. */ final boolean casBase(long cmp, long val) { return UNSAFE.compareAndSwapLong(this, baseOffset, cmp, val); }
/** * CASes the base field. */ final boolean casBase(long cmp, long val) { return UNSAFE.compareAndSwapLong(this, baseOffset, cmp, val); }
/** * CASes the base field. */ final boolean casBase(long cmp, long val) { return UNSAFE.compareAndSwapLong(this, baseOffset, cmp, val); }
/** CASes the base field. */ final boolean casBase(long cmp, long val) { return UNSAFE.compareAndSwapLong(this, baseOffset, cmp, val); }
/** CASes the base field. */ final boolean casBase(long cmp, long val) { return UNSAFE.compareAndSwapLong(this, baseOffset, cmp, val); }
boolean casWriteCounter(long expect, long update) { return UnsafeAccess.UNSAFE.compareAndSwapLong(this, WRITE_OFFSET, expect, update); } }
boolean casWriteCounter(long expect, long update) { return UnsafeAccess.UNSAFE.compareAndSwapLong(this, WRITE_OFFSET, expect, update); } }
boolean casWriteCounter(long expect, long update) { return UnsafeAccess.UNSAFE.compareAndSwapLong(this, WRITE_OFFSET, expect, update); } }