Skip to content

Commit

Permalink
Make sure we don't try to use Channel.setReadable(true) if it was not
Browse files Browse the repository at this point in the history
set by the threadpool itself. See netty#215
  • Loading branch information
normanmaurer committed Mar 4, 2012
1 parent 69e047a commit 3317dd7
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -419,10 +419,18 @@ protected void decreaseCounter(Runnable task) {
//System.out.println("READABLE");
ChannelHandlerContext ctx = eventTask.getContext();
if (ctx.getHandler() instanceof ExecutionHandler) {
// readSuspended = false;
ctx.setAttachment(null);
// check if the attachment was set as this means that we suspend the channel from reads. This only works when
// this pool is used with ExecutionHandler but I guess thats good enough for us.
//
// See #215
if (ctx.getAttachment() != null) {
// readSuspended = false;
ctx.setAttachment(null);
channel.setReadable(true);
}
} else {
channel.setReadable(true);
}
channel.setReadable(true);
}
}
}
Expand Down

0 comments on commit 3317dd7

Please sign in to comment.