Small optimization: call readyOps() outside spin lock.
This commit is contained in:
parent
c25772e147
commit
72222ba8a3
|
@ -85,15 +85,13 @@ public class SelectChannelEndPoint extends ChannelEndPoint implements ManagedSel
|
||||||
* This method may run concurrently with {@link #changeInterests(int)}.
|
* This method may run concurrently with {@link #changeInterests(int)}.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int readyOps;
|
int readyOps = _key.readyOps();
|
||||||
int oldInterestOps;
|
int oldInterestOps;
|
||||||
int newInterestOps;
|
int newInterestOps;
|
||||||
try (SpinLock.Lock lock = _lock.lock())
|
try (SpinLock.Lock lock = _lock.lock())
|
||||||
{
|
{
|
||||||
_updatePending = true;
|
_updatePending = true;
|
||||||
|
|
||||||
// Remove the readyOps, that here can only be OP_READ or OP_WRITE (or both).
|
// Remove the readyOps, that here can only be OP_READ or OP_WRITE (or both).
|
||||||
readyOps = _key.readyOps();
|
|
||||||
oldInterestOps = _desiredInterestOps;
|
oldInterestOps = _desiredInterestOps;
|
||||||
newInterestOps = oldInterestOps & ~readyOps;
|
newInterestOps = oldInterestOps & ~readyOps;
|
||||||
_desiredInterestOps = newInterestOps;
|
_desiredInterestOps = newInterestOps;
|
||||||
|
|
Loading…
Reference in New Issue