Fixed a bug where DiscardClient didn't work since the last optimization
This commit is contained in:
parent
39086edae6
commit
362ecf640b
@ -318,7 +318,9 @@ class NioWorker implements Runnable {
|
||||
static void write(final NioSocketChannel channel, boolean mightNeedWakeup) {
|
||||
if (mightNeedWakeup) {
|
||||
NioWorker worker = channel.getWorker();
|
||||
if (worker != null && Thread.currentThread() != worker.thread) {
|
||||
if (worker != null) {
|
||||
Thread workerThread = worker.thread;
|
||||
if (workerThread != null && Thread.currentThread() != workerThread) {
|
||||
if (channel.writeTaskInTaskQueue.compareAndSet(false, true)) {
|
||||
worker.taskQueue.offer(channel.writeTask);
|
||||
}
|
||||
@ -328,6 +330,7 @@ class NioWorker implements Runnable {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!channel.isConnected()) {
|
||||
cleanUpWriteBuffer(channel);
|
||||
@ -367,7 +370,6 @@ class NioWorker implements Runnable {
|
||||
if (internalWriteBuffer.isEmpty()) {
|
||||
channel.writeBuffer.drainTo(internalWriteBuffer);
|
||||
}
|
||||
|
||||
evt = channel.currentWriteEvent;
|
||||
for (;;) {
|
||||
if (evt == null) {
|
||||
|
Loading…
Reference in New Issue
Block a user