Make AbstractChannel.outboundBuffer volatile.
Motivation: The field can be read from arbitrary threads via Channel.(isWritable()|bytesBeforeWritable()|bytesBeforeUnwritable()), WriteAndFlushTask.newInstance(), PendingWriteQueue, etc. Modifications: Make AbstractChannel.outboundBuffer volatile. Result: More correct in a concurrent use case.
This commit is contained in:
parent
df033e150c
commit
0fbb791ad6
@ -413,7 +413,7 @@ public abstract class AbstractChannel extends DefaultAttributeMap implements Cha
|
||||
*/
|
||||
protected abstract class AbstractUnsafe implements Unsafe {
|
||||
|
||||
private ChannelOutboundBuffer outboundBuffer = new ChannelOutboundBuffer(AbstractChannel.this);
|
||||
private volatile ChannelOutboundBuffer outboundBuffer = new ChannelOutboundBuffer(AbstractChannel.this);
|
||||
private RecvByteBufAllocator.Handle recvHandle;
|
||||
private boolean inFlush0;
|
||||
/** true if the channel has never been registered, false otherwise */
|
||||
|
Loading…
Reference in New Issue
Block a user