[#1812] All to have NioMessageUnsafe.read() inlined
This commit is contained in:
parent
af1ac4ca0c
commit
b53fa5dd70
@ -48,16 +48,19 @@ public abstract class AbstractNioMessageChannel extends AbstractNioChannel {
|
|||||||
|
|
||||||
private final List<Object> readBuf = new ArrayList<Object>();
|
private final List<Object> readBuf = new ArrayList<Object>();
|
||||||
|
|
||||||
|
private void removeReadOp() {
|
||||||
|
SelectionKey key = selectionKey();
|
||||||
|
int interestOps = key.interestOps();
|
||||||
|
if ((interestOps & readInterestOp) != 0) {
|
||||||
|
// only remove readInterestOp if needed
|
||||||
|
key.interestOps(interestOps & ~readInterestOp);
|
||||||
|
}
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
public void read() {
|
public void read() {
|
||||||
assert eventLoop().inEventLoop();
|
assert eventLoop().inEventLoop();
|
||||||
final SelectionKey key = selectionKey();
|
|
||||||
if (!config().isAutoRead()) {
|
if (!config().isAutoRead()) {
|
||||||
int interestOps = key.interestOps();
|
removeReadOp();
|
||||||
if ((interestOps & readInterestOp) != 0) {
|
|
||||||
// only remove readInterestOp if needed
|
|
||||||
key.interestOps(interestOps & ~readInterestOp);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
final ChannelConfig config = config();
|
final ChannelConfig config = config();
|
||||||
|
Loading…
Reference in New Issue
Block a user