Top Description Constructors Methods
io.netty.util.internal

public abstract Class ReferenceCountUpdater<T extends ReferenceCounted>

extends Object
Class Inheritance
Static Imports
io.netty.util.internal.ObjectUtil.checkPositive

Common logic for ReferenceCounted implementations

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static long
getUnsafeOffset(Class<? extends ReferenceCounted> clz, String fieldName)

public final int
public final boolean
isLiveNonVolatile(T instance)

private boolean
nonFinalRelease0(T instance, int decrement, int rawCnt, int realCnt)

private int
nonVolatileRawCnt(T instance)

private static int
realRefCnt(int rawCnt)

public final int
refCnt(T instance)

public final boolean
release(T instance)

public final boolean
release(T instance, int decrement)

public final void
resetRefCnt(T instance)

Resets the reference count to 1

public final T
retain(T instance)

public final T
retain(T instance, int increment)

private T
retain0(T instance, final int increment, final int rawIncrement)

private boolean
retryRelease0(T instance, int decrement)

public void
setInitialValue(T instance)

public final void
setRefCnt(T instance, int refCnt)

An unsafe operation that sets the reference count directly

private static int
toLiveRealRefCnt(int rawCnt, int decrement)

Like realRefCnt(int) but throws if refCnt == 0

private boolean
tryFinalRelease0(T instance, int expectRawCnt)

protected abstract long
protected abstract AtomicIntegerFieldUpdater<T>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ReferenceCountUpdaterback to summary
protected ReferenceCountUpdater()

Method Detail

getUnsafeOffsetback to summary
public static long getUnsafeOffset(Class<? extends ReferenceCounted> clz, String fieldName)
initialValueback to summary
public final int initialValue()
isLiveNonVolatileback to summary
public final boolean isLiveNonVolatile(T instance)
nonFinalRelease0back to summary
private boolean nonFinalRelease0(T instance, int decrement, int rawCnt, int realCnt)
nonVolatileRawCntback to summary
private int nonVolatileRawCnt(T instance)
realRefCntback to summary
private static int realRefCnt(int rawCnt)
refCntback to summary
public final int refCnt(T instance)
releaseback to summary
public final boolean release(T instance)
releaseback to summary
public final boolean release(T instance, int decrement)
resetRefCntback to summary
public final void resetRefCnt(T instance)

Resets the reference count to 1

retainback to summary
public final T retain(T instance)
retainback to summary
public final T retain(T instance, int increment)
retain0back to summary
private T retain0(T instance, final int increment, final int rawIncrement)
retryRelease0back to summary
private boolean retryRelease0(T instance, int decrement)
setInitialValueback to summary
public void setInitialValue(T instance)
setRefCntback to summary
public final void setRefCnt(T instance, int refCnt)

An unsafe operation that sets the reference count directly

toLiveRealRefCntback to summary
private static int toLiveRealRefCnt(int rawCnt, int decrement)

Like realRefCnt(int) but throws if refCnt == 0

tryFinalRelease0back to summary
private boolean tryFinalRelease0(T instance, int expectRawCnt)
unsafeOffsetback to summary
protected abstract long unsafeOffset()
updaterback to summary
protected abstract AtomicIntegerFieldUpdater<T> updater()