Reduced unnecessary Thread.currentThread() calls
This commit is contained in:
parent
5269e64598
commit
dd5354858e
@ -483,14 +483,13 @@ class NioWorker implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void rescheduleWrite(final NioSocketChannel channel) {
|
private void rescheduleWrite(final NioSocketChannel channel) {
|
||||||
final Thread currentThread = Thread.currentThread();
|
|
||||||
if (channel.writeTaskInTaskQueue.compareAndSet(false, true)) {
|
if (channel.writeTaskInTaskQueue.compareAndSet(false, true)) {
|
||||||
boolean offered = writeTaskQueue.offer(channel.writeTask);
|
boolean offered = writeTaskQueue.offer(channel.writeTask);
|
||||||
assert offered;
|
assert offered;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(channel instanceof NioAcceptedSocketChannel) ||
|
if (!(channel instanceof NioAcceptedSocketChannel) ||
|
||||||
((NioAcceptedSocketChannel) channel).bossThread != currentThread) {
|
((NioAcceptedSocketChannel) channel).bossThread != Thread.currentThread()) {
|
||||||
final Selector workerSelector = selector;
|
final Selector workerSelector = selector;
|
||||||
if (workerSelector != null) {
|
if (workerSelector != null) {
|
||||||
if (wakenUp.compareAndSet(false, true)) {
|
if (wakenUp.compareAndSet(false, true)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user