From bea8b40341cdbbb0fba5c37f514cea344e78a63d Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Mon, 12 Apr 2021 14:31:23 +0200 Subject: [PATCH] prevent JVM from exiting - because in FJP pool "all worker threads are initialized with Thread#isDaemon set `true`" cannot change `AppStarter.start` method signature for now to return CompletableFuture GitOrigin-RevId: c9aaae33c76ba5df48bdf120e13f02cab9d38cf8 --- platform/platform-impl/src/com/intellij/idea/StartupUtil.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/platform/platform-impl/src/com/intellij/idea/StartupUtil.java b/platform/platform-impl/src/com/intellij/idea/StartupUtil.java index ff5a83f4641f..d346f89872c0 100644 --- a/platform/platform-impl/src/com/intellij/idea/StartupUtil.java +++ b/platform/platform-impl/src/com/intellij/idea/StartupUtil.java @@ -256,6 +256,10 @@ public final class StartupUtil { importConfig(Arrays.asList(args), log, appStarterFuture, agreementDialogWasShown); } getAppStarter(appStarterFuture).start(Arrays.asList(args), prepareUiFuture); + + // prevent JVM from exiting - because in FJP pool "all worker threads are initialized with {@link Thread#isDaemon} set {@code true}" + // cannot change `AppStarter.start` method signature for now to return CompletableFuture + ForkJoinPool.commonPool().awaitQuiescence(Long.MAX_VALUE, TimeUnit.NANOSECONDS); } /** Called via reflection from {@link com.intellij.ide.WindowsCommandLineProcessor#processWindowsLauncherCommandLine}. */ -- 2.23.3