mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Enable multithreaded indexing in unit tests (and other headless environments)
GitOrigin-RevId: c06beda02d20e8b8f9f0cb8eb7c8d3f0910c8ebc
This commit is contained in:
committed by
intellij-monorepo-bot
parent
50b2c6aedd
commit
976d4b6edf
+8
-1
@@ -382,7 +382,14 @@ public final class PushedFilePropertiesUpdaterImpl extends PushedFilePropertiesU
|
||||
|
||||
public static void invokeConcurrentlyIfPossible(@NotNull List<? extends Runnable> tasks) {
|
||||
if (tasks.isEmpty()) return;
|
||||
if (tasks.size() == 1 || ApplicationManager.getApplication().isWriteAccessAllowed() || DumbServiceImpl.isSynchronousTaskExecution()) {
|
||||
boolean synchronous = (tasks.size() == 1);
|
||||
if (DumbServiceImpl.isSynchronousTaskExecution()) {
|
||||
synchronous = true;
|
||||
}
|
||||
else {
|
||||
LOG.assertTrue(!ApplicationManager.getApplication().isWriteAccessAllowed(), "Write access is not allowed");
|
||||
}
|
||||
if (synchronous) {
|
||||
for (Runnable r : tasks) r.run();
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user