diff --git a/buffer/src/main/java/io/netty/buffer/PoolArena.java b/buffer/src/main/java/io/netty/buffer/PoolArena.java index 0a3f9f429e..6acd979665 100644 --- a/buffer/src/main/java/io/netty/buffer/PoolArena.java +++ b/buffer/src/main/java/io/netty/buffer/PoolArena.java @@ -151,11 +151,13 @@ abstract class PoolArena { buf.initUnpooled(newUnpooledChunk(reqCapacity), reqCapacity); } - synchronized void free(PoolChunk chunk, long handle) { + void free(PoolChunk chunk, long handle) { if (chunk.unpooled) { destroyChunk(chunk); } else { - chunk.parent.free(chunk, handle); + synchronized(this) { + chunk.parent.free(chunk, handle); + } } }