minor ProcessIOExecutorService fixes (IDEA-CR-9926)

This commit is contained in:
peter
2016-04-06 19:44:29 +02:00
parent bc949b2072
commit 0ab1fb4a77
3 changed files with 3 additions and 9 deletions
@@ -19,14 +19,8 @@ public class ProcessIOExecutorService extends ThreadPoolExecutor {
public static final String POOLED_THREAD_PREFIX = "Process I/O pool ";
public static final ProcessIOExecutorService INSTANCE = new ProcessIOExecutorService();
/**
* 3 for each process: ProcessWaitFor + 2 x BaseDataReader (stdout and stderr)
* Allow for at least 2 processes: fsnotifier and external build/VCS/run configuration
*/
private static final int CORE_POOL_SIZE = 3 * 3;
private ProcessIOExecutorService() {
super(CORE_POOL_SIZE, Integer.MAX_VALUE, 1, TimeUnit.MINUTES, new SynchronousQueue<Runnable>(), new ThreadFactory() {
super(1, Integer.MAX_VALUE, 1, TimeUnit.MINUTES, new SynchronousQueue<Runnable>(), new ThreadFactory() {
private final AtomicInteger counter = new AtomicInteger();
@NotNull
@Override
@@ -41,7 +41,7 @@ public class ProcessWaitFor {
public void run() {
String oldThreadName = Thread.currentThread().getName();
if (!StringUtil.isEmptyOrSpaces(presentableName)) {
Thread.currentThread().setName(oldThreadName + ": " + StringUtil.first("ProcessWaitFor: " + presentableName, 120, true));
Thread.currentThread().setName(StringUtil.first("ProcessWaitFor: " + presentableName, 120, true));
}
int exitCode = 0;
try {
@@ -55,7 +55,7 @@ public abstract class BaseDataReader {
public void run() {
String oldThreadName = Thread.currentThread().getName();
if (!StringUtil.isEmptyOrSpaces(presentableName)) {
Thread.currentThread().setName(oldThreadName + ": " + StringUtil.first("BaseDataReader: " + presentableName, 120, true));
Thread.currentThread().setName(StringUtil.first("BaseDataReader: " + presentableName, 120, true));
}
try {
doRun();