From 8a1f104aa4af7d4962ac333624529c2d084c5c92 Mon Sep 17 00:00:00 2001 From: Jonathan Gamble Date: Wed, 27 Nov 2024 17:53:07 -0600 Subject: [PATCH] dont report negative size in unlucky scheduling scenario --- src/main/scala/netty/ActorChannelConnector.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/netty/ActorChannelConnector.scala b/src/main/scala/netty/ActorChannelConnector.scala index 08cda080..85eaff40 100644 --- a/src/main/scala/netty/ActorChannelConnector.scala +++ b/src/main/scala/netty/ActorChannelConnector.scala @@ -97,8 +97,8 @@ object ActorChannelConnector: private val size = java.util.concurrent.atomic.AtomicInteger() def add(channel: Channel): Unit = - queue.add(channel) size.getAndIncrement() + queue.add(channel) def poll(): Option[Channel] = val maybeChannel = Option(queue.poll())