File tree Expand file tree Collapse file tree 1 file changed +1
-1
lines changed
src/library/scala/concurrent Expand file tree Collapse file tree 1 file changed +1
-1
lines changed Original file line number Diff line number Diff line change @@ -213,7 +213,7 @@ private[concurrent] trait BatchingExecutor extends Executor {
213
213
Objects .requireNonNull(runnable, " runnable is null" )
214
214
val b = _tasksLocal.get
215
215
if (b.isInstanceOf [Batch ]) b.asInstanceOf [Batch ].push(runnable)
216
- else if (b != null ) {
216
+ else if (b == null ) { // If there is null in _tasksLocal, set a marker and run, inflate the Batch only if needed
217
217
_tasksLocal.set(BatchingExecutorStatics .marker) // Set a marker to indicate that we are submitting synchronously
218
218
runnable.run() // If we observe a non-null task which isn't a batch here, then allocate a batch
219
219
_tasksLocal.remove() // Since we are executing synchronously, we can clear this at the end of execution
You can’t perform that action at this time.
0 commit comments