@@ -16,7 +16,6 @@ package org.apache.pekko.dispatch
16
16
import org .apache .pekko
17
17
import pekko .annotation .InternalApi
18
18
19
- import java .util .ArrayDeque
20
19
import java .util .concurrent .Executor
21
20
import scala .annotation .tailrec
22
21
import scala .concurrent ._
@@ -67,10 +66,10 @@ private[pekko] trait BatchingExecutor extends Executor {
67
66
// invariant: if "_tasksLocal.get ne null" then we are inside Batch.run; if it is null, we are outside
68
67
private [this ] val _tasksLocal = new ThreadLocal [AbstractBatch ]()
69
68
70
- private [this ] abstract class AbstractBatch extends ArrayDeque [Runnable ](4 ) with Runnable {
69
+ private [this ] abstract class AbstractBatch extends java.util. ArrayDeque [Runnable ](4 ) with Runnable {
71
70
@ tailrec final def processBatch (batch : AbstractBatch ): Unit =
72
71
if ((batch eq this ) && ! batch.isEmpty) {
73
- batch.poll ().run()
72
+ batch.pollFirst ().run()
74
73
processBatch(_tasksLocal.get) // If this is null, then we have been using managed blocking, so bail out
75
74
}
76
75
@@ -85,7 +84,7 @@ private[pekko] trait BatchingExecutor extends Executor {
85
84
}
86
85
87
86
private [this ] final class Batch extends AbstractBatch {
88
- override final def run : Unit = {
87
+ override final def run () : Unit = {
89
88
require(_tasksLocal.get eq null )
90
89
_tasksLocal.set(this ) // Install ourselves as the current batch
91
90
try processBatch(this )
0 commit comments