[#1812] All to have NioMessageUnsafe.read() inlined

This commit is contained in:
Norman Maurer 2013-10-26 17:43:10 +02:00
parent af1ac4ca0c
commit b53fa5dd70

View File

@ -48,17 +48,20 @@ public abstract class AbstractNioMessageChannel extends AbstractNioChannel {
private final List<Object> readBuf = new ArrayList<Object>(); private final List<Object> readBuf = new ArrayList<Object>();
@Override private void removeReadOp() {
public void read() { SelectionKey key = selectionKey();
assert eventLoop().inEventLoop();
final SelectionKey key = selectionKey();
if (!config().isAutoRead()) {
int interestOps = key.interestOps(); int interestOps = key.interestOps();
if ((interestOps & readInterestOp) != 0) { if ((interestOps & readInterestOp) != 0) {
// only remove readInterestOp if needed // only remove readInterestOp if needed
key.interestOps(interestOps & ~readInterestOp); key.interestOps(interestOps & ~readInterestOp);
} }
} }
@Override
public void read() {
assert eventLoop().inEventLoop();
if (!config().isAutoRead()) {
removeReadOp();
}
final ChannelConfig config = config(); final ChannelConfig config = config();
final int maxMessagesPerRead = config.getMaxMessagesPerRead(); final int maxMessagesPerRead = config.getMaxMessagesPerRead();