don't report leaked threads from process pool

This commit is contained in:
peter
2016-04-06 12:23:33 +02:00
parent 56d5fdda05
commit 4ec6bf9246
2 changed files with 7 additions and 2 deletions
@@ -15,6 +15,7 @@
*/
package com.intellij.testFramework;
import com.intellij.execution.process.ProcessIOExecutorService;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.project.ProjectManager;
@@ -92,7 +93,10 @@ public class ThreadTracker {
wellKnownOffenders.add("VM Thread");
wellKnownOffenders.add("YJPAgent-Telemetry");
longRunningThreadCreated(ApplicationManager.getApplication(), "Periodic tasks thread", "ApplicationImpl pooled thread");
longRunningThreadCreated(ApplicationManager.getApplication(),
"Periodic tasks thread",
"ApplicationImpl pooled thread ",
ProcessIOExecutorService.POOLED_THREAD_PREFIX);
}
// marks Thread with this name as long-running, which should be ignored from the thread-leaking checks
@@ -16,6 +16,7 @@ import java.util.concurrent.atomic.AtomicInteger;
* @author peter
*/
public class ProcessIOExecutorService extends ThreadPoolExecutor {
public static final String POOLED_THREAD_PREFIX = "Process I/O pool ";
public static final ProcessIOExecutorService INSTANCE = new ProcessIOExecutorService();
/**
@@ -30,7 +31,7 @@ public class ProcessIOExecutorService extends ThreadPoolExecutor {
@NotNull
@Override
public Thread newThread(@NotNull final Runnable r) {
Thread thread = new Thread(r, "Process I/O pool " + counter.incrementAndGet());
Thread thread = new Thread(r, POOLED_THREAD_PREFIX + counter.incrementAndGet());
thread.setPriority(Thread.NORM_PRIORITY - 1);
return thread;
}