mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
restore actual count value (for IDEA-CR-41523)
This commit is contained in:
@@ -17,8 +17,6 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
public class ProcessIOExecutorService extends ThreadPoolExecutor {
|
||||
public static final String POOLED_THREAD_PREFIX = "Process I/O pool ";
|
||||
public static final ExecutorService INSTANCE = new ProcessIOExecutorService();
|
||||
private final AtomicInteger counter = new AtomicInteger();
|
||||
|
||||
|
||||
private ProcessIOExecutorService() {
|
||||
super(1, Integer.MAX_VALUE, 1, TimeUnit.MINUTES, new SynchronousQueue<Runnable>(), new CountingThreadFactory() {
|
||||
@@ -34,6 +32,6 @@ public class ProcessIOExecutorService extends ThreadPoolExecutor {
|
||||
|
||||
@TestOnly
|
||||
public int getThreadCounter() {
|
||||
return counter.get();
|
||||
return ((CountingThreadFactory)getThreadFactory()).getCount();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,4 +6,8 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
public abstract class CountingThreadFactory implements ThreadFactory {
|
||||
protected final AtomicInteger counter = new AtomicInteger();
|
||||
|
||||
public int getCount() {
|
||||
return counter.get();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user