do not run automake in alarm's thread

This commit is contained in:
Eugene Zhuravlev
2012-01-31 18:12:22 +01:00
parent 957718c0b6
commit a1ff4d0fd3
2 changed files with 13 additions and 7 deletions
@@ -128,12 +128,17 @@ public class CompileServerManager implements ApplicationComponent{
@Override
public void run() {
if (!myAutoMakeInProgress.getAndSet(true)) {
try {
runAutoMake();
}
finally {
myAutoMakeInProgress.set(false);
}
ApplicationManager.getApplication().executeOnPooledThread(new Runnable() {
@Override
public void run() {
try {
runAutoMake();
}
finally {
myAutoMakeInProgress.set(false);
}
}
});
}
else {
scheduleMake(this);
@@ -26,6 +26,7 @@ import com.intellij.openapi.compiler.CompilerBundle;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.projectRoots.Sdk;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.CharsetToolkit;
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VfsUtil;
@@ -155,7 +156,7 @@ public class CompilerUtil {
public static void addSourceCommandLineSwitch(final Sdk jdk, LanguageLevel chunkLanguageLevel, @NonNls final List<String> commandLine) {
final String versionString = jdk.getVersionString();
if (versionString == null || "".equals(versionString)) {
if (StringUtil.isEmpty(versionString)) {
throw new IllegalArgumentException(CompilerBundle.message("javac.error.unknown.jdk.version", jdk.getName()));
}