private static AtomicReferenceFieldUpdater<SessionImpl, Object> createTokenUpdater() { return AtomicReferenceFieldUpdater.newUpdater(SessionImpl.class, Object.class, "evictionToken"); }
static <T, V> AtomicReferenceFieldUpdater<T, V> newRefUpdater(Class<T> tclass, Class<V> vclass, String fieldName) { if (AVAILABLE) { return AtomicReferenceFieldUpdater.newUpdater(tclass, vclass, fieldName); } else { return null; } }
private static class Node<E> { private volatile E item; private volatile Node<E> next; private static final AtomicReferenceFieldUpdater<Node, Node> nextUpdater = AtomicReferenceFieldUpdater.newUpdater(Node.class, Node.class, "next"); private static final AtomicReferenceFieldUpdater<Node, Object> itemUpdater = AtomicReferenceFieldUpdater.newUpdater(Node.class, Object.class, "item"); Node(E x) { item = x; } Node(E x, Node<E> n) { item = x; next = n; } E getItem() { return item; } boolean casItem(E cmp, E val) { return itemUpdater.compareAndSet(this, cmp, val); } void setItem(E val) { itemUpdater.set(this, val); } Node<E> getNext() { return next; } boolean casNext(Node<E> cmp, Node<E> val) { return nextUpdater.compareAndSet(this, cmp, val); } void setNext(Node<E> val) { nextUpdater.set(this, val); } }
/** * Creates and returns an updater for objects with the given field. * * @param tClass the class of the objects holding the field. * @param vClass the class of the field * @param fieldName the name of the field to be updated. */ public static <U, W> AtomicReferenceFieldUpdater<U, W> newAtomicReferenceFieldUpdater( Class<U> tClass, Class<W> vClass, String fieldName) { try { return new UnsafeAtomicReferenceFieldUpdater<>(UnsafeUtil.getUnsafe(), tClass, fieldName); } catch (Throwable t) { return AtomicReferenceFieldUpdater.newUpdater(tClass, vClass, fieldName); } }
/** * Creates and returns an updater for objects with the given field. * * @param tClass the class of the objects holding the field. * @param vClass the class of the field * @param fieldName the name of the field to be updated. */ public static <U, W> AtomicReferenceFieldUpdater<U, W> newAtomicReferenceFieldUpdater( Class<U> tClass, Class<W> vClass, String fieldName) { try { return new UnsafeAtomicReferenceFieldUpdater<>(UnsafeUtil.getUnsafe(), tClass, fieldName); } catch (Throwable t) { return AtomicReferenceFieldUpdater.newUpdater(tClass, vClass, fieldName); } }
AtomicReferenceFieldUpdater.newUpdater(GridDhtTxLocalAdapter.class, IgniteInternalFuture.class, "lockFut");
private static final AtomicReferenceFieldUpdater<AbstractAcceptingSslChannel, SslClientAuthMode> clientAuthModeUpdater = AtomicReferenceFieldUpdater.newUpdater(AbstractAcceptingSslChannel.class, SslClientAuthMode.class, "clientAuthMode"); @SuppressWarnings("rawtypes") private static final AtomicIntegerFieldUpdater<AbstractAcceptingSslChannel> useClientModeUpdater = AtomicIntegerFieldUpdater.newUpdater(AbstractAcceptingSslChannel.class, "useClientMode"); private static final AtomicIntegerFieldUpdater<AbstractAcceptingSslChannel> enableSessionCreationUpdater = AtomicIntegerFieldUpdater.newUpdater(AbstractAcceptingSslChannel.class, "enableSessionCreation"); @SuppressWarnings("rawtypes") private static final AtomicReferenceFieldUpdater<AbstractAcceptingSslChannel, String[]> cipherSuitesUpdater = AtomicReferenceFieldUpdater.newUpdater(AbstractAcceptingSslChannel.class, String[].class, "cipherSuites"); @SuppressWarnings("rawtypes") private static final AtomicReferenceFieldUpdater<AbstractAcceptingSslChannel, String[]> protocolsUpdater = AtomicReferenceFieldUpdater.newUpdater(AbstractAcceptingSslChannel.class, String[].class, "protocols");
AtomicReferenceFieldUpdater.newUpdater(IgniteTxLocalAdapter.class, Throwable.class, "commitErr");
AtomicReferenceFieldUpdater.newUpdater(GridDhtTxLocal.class, GridDhtTxPrepareFuture.class, "prepFut");
AtomicReferenceFieldUpdater.newUpdater(IgniteTxAdapter.class, FinalizationStatus.class, "finalizing"); AtomicReferenceFieldUpdater.newUpdater(IgniteTxAdapter.class, TxCounters.class, "txCounters");
AtomicReferenceFieldUpdater.newUpdater(GridNearTxLocal.class, IgniteInternalFuture.class, "prepFut"); AtomicReferenceFieldUpdater.newUpdater(GridNearTxLocal.class, NearTxFinishFuture.class, "finishFut");
static <T, V> AtomicReferenceFieldUpdater<T, V> newRefUpdater(Class<T> tclass, Class<V> vclass, String fieldName) { if (AVAILABLE) { return AtomicReferenceFieldUpdater.newUpdater(tclass, vclass, fieldName); } else { return null; } }
static <T, V> AtomicReferenceFieldUpdater<T, V> newRefUpdater(Class<T> tclass, Class<V> vclass, String fieldName) { if (AVAILABLE) { return AtomicReferenceFieldUpdater.newUpdater(tclass, vclass, fieldName); } else { return null; } }
public AtomicReferenceFieldUpdater<ConcurrentSkipListMap, HeadIndex> run() { return AtomicReferenceFieldUpdater.newUpdater(ConcurrentSkipListMap.class, HeadIndex.class, "head"); } });
public AtomicReferenceFieldUpdater<Index, Index> run() { return AtomicReferenceFieldUpdater.newUpdater(Index.class, Index.class, "right"); } });
static <T, V> AtomicReferenceFieldUpdater<T, V> newRefUpdater(Class<T> tclass, Class<V> vclass, String fieldName) { if (AVAILABLE) { return AtomicReferenceFieldUpdater.newUpdater(tclass, vclass, fieldName); } else { return null; } }
static <T, V> AtomicReferenceFieldUpdater<T,V> newRefUpdater(Class<T> tclass, Class<V> vclass, String fieldName) { if (AVAILABLE) { return AtomicReferenceFieldUpdater.newUpdater(tclass, vclass, fieldName); } else { return null; } }
class Cls extends Base { val updater = AtomicReferenceFieldUpdater.newUpdater(classOf[Base[_]], classOf[Object[_]], "field") def cas[A](old: Object, n: Object) = updater.compareAndSet(this, old, n); }
public AtomicReferenceFieldUpdater<Node, Node> run() { return AtomicReferenceFieldUpdater.newUpdater(Node.class, Node.class, "next"); } });
/** * Creates and returns an updater for objects with the given reference field. */ public static <T, V> AtomicReferenceFieldUpdater<T, V> newReferenceFieldUpdater( Class<T> tclass, Class<V> vclass, String fieldName) { if (UnsafeHolder.hasUnsafe()) { return new UnsafeAtomicReferenceUpdater<T, V>(tclass, vclass, fieldName); } else { return AtomicReferenceFieldUpdater.newUpdater(tclass, vclass, fieldName); } }