[#2021] No need to synchronize for unpooled chunks

This commit is contained in:
Norman Maurer 2013-11-30 19:48:40 +01:00
parent 17f5865e38
commit 14600167d6
1 changed files with 4 additions and 2 deletions

View File

@ -151,11 +151,13 @@ abstract class PoolArena<T> {
buf.initUnpooled(newUnpooledChunk(reqCapacity), reqCapacity);
}
synchronized void free(PoolChunk<T> chunk, long handle) {
void free(PoolChunk<T> chunk, long handle) {
if (chunk.unpooled) {
destroyChunk(chunk);
} else {
chunk.parent.free(chunk, handle);
synchronized(this) {
chunk.parent.free(chunk, handle);
}
}
}