rename Interest

This commit is contained in:
Greg Wilkins 2017-02-25 12:37:21 +09:00
parent db7d89a5c9
commit 45232639ba
1 changed files with 5 additions and 7 deletions

View File

@ -96,17 +96,15 @@ public class HttpChannelState
{ {
NONE(false), NONE(false),
NEEDED(true), NEEDED(true),
INTERESTED(true); REGISTERED(true);
final boolean _interested; final boolean _interested;
boolean isInterested() { return _interested;} boolean isInterested() { return _interested;}
boolean notInterested() { return !_interested;}
Interest(boolean interest) Interest(boolean interest)
{ {
_interested = interest; _interested = interest;
} }
} }
private final boolean DEBUG=LOG.isDebugEnabled(); private final boolean DEBUG=LOG.isDebugEnabled();
@ -443,7 +441,7 @@ public class HttpChannelState
action=Action.WAIT; action=Action.WAIT;
if (_asyncRead==Interest.NEEDED) if (_asyncRead==Interest.NEEDED)
{ {
_asyncRead=Interest.INTERESTED; _asyncRead=Interest.REGISTERED;
read_interested=true; read_interested=true;
} }
Scheduler scheduler=_channel.getScheduler(); Scheduler scheduler=_channel.getScheduler();
@ -986,13 +984,13 @@ public class HttpChannelState
try(Locker.Lock lock= _locker.lock()) try(Locker.Lock lock= _locker.lock())
{ {
// We were already unready, this is not a state change, so do nothing // We were already unready, this is not a state change, so do nothing
if (_asyncRead!=Interest.INTERESTED) if (_asyncRead!=Interest.REGISTERED)
{ {
_asyncReadPossible=false; // Assumes this has been checked in isReady() with lock held _asyncReadPossible=false; // Assumes this has been checked in isReady() with lock held
if (_state==State.ASYNC_WAIT) if (_state==State.ASYNC_WAIT)
{ {
interested=true; interested=true;
_asyncRead=Interest.INTERESTED; _asyncRead=Interest.REGISTERED;
} }
else else
_asyncRead=Interest.NEEDED; _asyncRead=Interest.NEEDED;
@ -1037,7 +1035,7 @@ public class HttpChannelState
boolean woken=false; boolean woken=false;
try(Locker.Lock lock= _locker.lock()) try(Locker.Lock lock= _locker.lock())
{ {
_asyncRead=Interest.INTERESTED; _asyncRead=Interest.REGISTERED;
_asyncReadPossible=true; _asyncReadPossible=true;
if (_state==State.ASYNC_WAIT) if (_state==State.ASYNC_WAIT)
{ {