diff --git a/src/main/java/io/netty/buffer/api/BufRef.java b/src/main/java/io/netty/buffer/api/BufRef.java index 6e6d56a..7380d8f 100644 --- a/src/main/java/io/netty/buffer/api/BufRef.java +++ b/src/main/java/io/netty/buffer/api/BufRef.java @@ -29,6 +29,7 @@ public final class BufRef extends BufHolder { */ public BufRef(Buf buf) { super(buf); + // BufRef is meant to be atomic, so we need to add a fence to get the semantics of a volatile store. VarHandle.fullFence(); } @@ -39,6 +40,7 @@ public final class BufRef extends BufHolder { */ public BufRef(Send send) { super(send); + // BufRef is meant to be atomic, so we need to add a fence to get the semantics of a volatile store. VarHandle.fullFence(); } diff --git a/src/main/java/io/netty/buffer/api/memseg/BifurcatedDrop.java b/src/main/java/io/netty/buffer/api/memseg/BifurcatedDrop.java index 0322ad5..91629d2 100644 --- a/src/main/java/io/netty/buffer/api/memseg/BifurcatedDrop.java +++ b/src/main/java/io/netty/buffer/api/memseg/BifurcatedDrop.java @@ -50,7 +50,7 @@ class BifurcatedDrop implements Drop { } @Override - public synchronized void drop(MemSegBuf buf) { + public void drop(MemSegBuf buf) { int c; int n; do {