public abstract class AbstractReferenceCounted extends java.lang.Object implements ReferenceCounted
ReferenceCounted
。
Constructor and Description |
---|
AbstractReferenceCounted() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
deallocate()
一次调用
refCnt() 等于0。
|
int |
refCnt()
返回此对象的引用计数。
|
boolean |
release()
通过减小引用计数
1 并且如果所述引用计数达到在将释放该对象
0 。
|
boolean |
release(int decrement)
减小由指定的引用计数
decrement 并且如果所述引用计数达到在将释放该对象
0 。
|
ReferenceCounted |
retain()
将引用计数增加
1 。
|
ReferenceCounted |
retain(int increment)
通过指定的
increment 增加参考计数。
|
protected void |
setRefCnt(int refCnt)
一个不安全的操作,旨在供直接设置缓冲区引用计数的子类使用
|
ReferenceCounted |
touch()
记录此对象的当前访问位置以进行调试。
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
touch
public final int refCnt()
ReferenceCounted
复制的描述
0
,则表示该对象已被释放。
refCnt
在界面
ReferenceCounted
protected final void setRefCnt(int refCnt)
public ReferenceCounted retain()
ReferenceCounted
1
。
retain
在界面
ReferenceCounted
public ReferenceCounted retain(int increment)
ReferenceCounted
increment
。
retain
在界面
ReferenceCounted
public ReferenceCounted touch()
ReferenceCounted
touch
在界面
ReferenceCounted
public boolean release()
ReferenceCounted
1
并且如果所述引用计数达到在将释放该对象
0
。
release
,界面
ReferenceCounted
true
当且仅当引用计数变为
0
且此对象已被释放
public boolean release(int decrement)
ReferenceCounted
decrement
并且如果所述引用计数达到在将释放该对象
0
。
release
在界面
ReferenceCounted
true
当且仅当引用计数变为
0
且此对象已被释放
protected abstract void deallocate()
refCnt()
等于0。
Copyright © 2008–2018 The Netty Project. All rights reserved.