Add setRefCnt(int) method to AbstractReferenceCounted(ByteBuf)

- Fixes #1265
This commit is contained in:
Trustin Lee 2013-04-11 19:36:27 +09:00
parent 2600f46fd7
commit 5bfb408b7d
2 changed files with 14 additions and 0 deletions

View File

@ -56,6 +56,13 @@ public abstract class AbstractReferenceCounted implements ReferenceCounted {
}
}
/**
* An unsafe operation intended for use by a subclass that sets the reference count of the buffer directly
*/
protected final void setRefCnt(int refCnt) {
this.refCnt = refCnt;
}
@Override
public ReferenceCounted retain() {
for (;;) {

View File

@ -61,6 +61,13 @@ public abstract class AbstractReferenceCountedByteBuf extends AbstractByteBuf {
}
}
/**
* An unsafe operation intended for use by a subclass that sets the reference count of the buffer directly
*/
protected final void setRefCnt(int refCnt) {
this.refCnt = refCnt;
}
@Override
public ByteBuf retain() {
for (;;) {