lower network priority generally

This commit is contained in:
Bixilon 2023-05-31 22:07:10 +02:00
parent 1dc689baf5
commit d95e508219
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4

View File

@ -40,7 +40,7 @@ class ClientPacketHandler(
override fun channelRead0(context: ChannelHandlerContext, queued: QueuedS2CP<*>) {
if (queued.type.threadSafe && (DefaultThreadPool.queueSize < DefaultThreadPool.threadCount - 1 || queued.type.lowPriority)) { // only handle async when thread pool not busy
val runnable = SimplePoolRunnable(priority = if (queued.type.lowPriority) ThreadPool.Priorities.HIGH else ThreadPool.Priorities.HIGHER)
val runnable = SimplePoolRunnable(priority = if (queued.type.lowPriority) ThreadPool.Priorities.NORMAL else ThreadPool.Priorities.HIGH)
runnable.runnable = Runnable { tryHandle(context, queued.type, queued.packet) }
DefaultThreadPool += runnable
} else {