Skip to content

Commit cea4471

Browse files
authored
Merge pull request scala/scala#10528 from dkomanov/fix-issue-9304
Fixes issue with blocking and BatchingExecutor
2 parents f1228bb + 80b24e9 commit cea4471

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/src/scala/concurrent/BatchingExecutor.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ private[concurrent] trait BatchingExecutor extends Executor {
6060
parentBlockContext = prevBlockContext
6161

6262
@tailrec def processBatch(batch: List[Runnable]): Unit = batch match {
63-
case Nil => ()
63+
case null | Nil => ()
6464
case head :: tail =>
6565
_tasksLocal set tail
6666
try {
@@ -91,7 +91,7 @@ private[concurrent] trait BatchingExecutor extends Executor {
9191
// if we know there will be blocking, we don't want to keep tasks queued up because it could deadlock.
9292
{
9393
val tasks = _tasksLocal.get
94-
_tasksLocal set Nil
94+
_tasksLocal set null
9595
if ((tasks ne null) && tasks.nonEmpty)
9696
unbatchedExecute(new Batch(tasks))
9797
}

0 commit comments

Comments
 (0)