Skip to content

Commit aeb2ba5

Browse files
committed
chore: Avoid forwarding method on ArrayDequeue in BatchingExecutor.
1 parent 477fd39 commit aeb2ba5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

actor/src/main/scala/org/apache/pekko/dispatch/BatchingExecutor.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ package org.apache.pekko.dispatch
1616
import org.apache.pekko
1717
import pekko.annotation.InternalApi
1818

19-
import java.util.ArrayDeque
19+
import java.util
2020
import java.util.concurrent.Executor
2121
import scala.annotation.tailrec
2222
import scala.concurrent._
@@ -67,10 +67,10 @@ private[pekko] trait BatchingExecutor extends Executor {
6767
// invariant: if "_tasksLocal.get ne null" then we are inside Batch.run; if it is null, we are outside
6868
private[this] val _tasksLocal = new ThreadLocal[AbstractBatch]()
6969

70-
private[this] abstract class AbstractBatch extends ArrayDeque[Runnable](4) with Runnable {
70+
private[this] abstract class AbstractBatch extends util.ArrayDeque[Runnable](4) with Runnable {
7171
@tailrec final def processBatch(batch: AbstractBatch): Unit =
7272
if ((batch eq this) && !batch.isEmpty) {
73-
batch.poll().run()
73+
batch.pollFirst().run()
7474
processBatch(_tasksLocal.get) // If this is null, then we have been using managed blocking, so bail out
7575
}
7676

@@ -85,7 +85,7 @@ private[pekko] trait BatchingExecutor extends Executor {
8585
}
8686

8787
private[this] final class Batch extends AbstractBatch {
88-
override final def run: Unit = {
88+
override final def run(): Unit = {
8989
require(_tasksLocal.get eq null)
9090
_tasksLocal.set(this) // Install ourselves as the current batch
9191
try processBatch(this)

0 commit comments

Comments
 (0)