Remove explicit AppScheduledExecutorService shutdown (commit revert)

Revert "Problem: manually shutdown AppScheduledExecutorService to allow compiler stop properly"

The commit was added during update to 162.1024.1 to fix hangs in ant
tasks on teamcity because of some thread created in
AppScheduledExecutorService service.

Remove the commit because can't reproduce those hangs under 162.2946
(Probably https://github.com/JetBrains/intellij-community/commit/12a079ef41882343bf83ef2a7dcee820b55fd154 fixed the hangs).

This should also be addressed in fix for https://youtrack.jetbrains.com/issue/IDEA-169562

This reverts commit 99a75021e1.
This commit is contained in:
Nikolay Krasko
2017-03-14 16:04:35 +03:00
parent a63953432e
commit f38753ee3c
4 changed files with 8 additions and 33 deletions
@@ -20,8 +20,6 @@ import com.google.common.base.Predicates;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.util.concurrency.AppExecutorUtil;
import com.intellij.util.concurrency.AppScheduledExecutorService;
import kotlin.collections.ArraysKt;
import kotlin.jvm.functions.Function1;
import org.fusesource.jansi.AnsiConsole;
@@ -379,16 +377,9 @@ public abstract class CLICompiler<A extends CommonCompilerArguments> {
// We depend on swing (indirectly through PSI or something), so we want to declare headless mode,
// to avoid accidentally starting the UI thread
System.setProperty("java.awt.headless", "true");
try {
ExitCode exitCode = doMainNoExit(compiler, args);
if (exitCode != OK) {
System.exit(exitCode.getCode());
}
}
finally {
AppScheduledExecutorService service = (AppScheduledExecutorService) AppExecutorUtil.getAppScheduledExecutorService();
service.shutdownAppScheduledExecutorService();
ExitCode exitCode = doMainNoExit(compiler, args);
if (exitCode != OK) {
System.exit(exitCode.getCode());
}
}
@@ -105,7 +105,6 @@ import org.jetbrains.kotlin.script.KotlinScriptDefinitionProvider
import org.jetbrains.kotlin.script.KotlinScriptExternalImportsProvider
import org.jetbrains.kotlin.utils.PathUtil
import java.io.File
import java.lang.IllegalStateException
import java.util.*
class KotlinCoreEnvironment private constructor(