Skip to content

Commit

Permalink
dont report negative size in unlucky scheduling scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
schlawg committed Nov 27, 2024
1 parent ff0c941 commit 8a1f104
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/scala/netty/ActorChannelConnector.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 8a1f104

Please sign in to comment.