7165762: (aio) Default thread pool should be configured so that threads terminated after a timeout period
Reviewed-by: chegar
--- a/jdk/src/share/classes/sun/nio/ch/ThreadPool.java Fri Nov 30 11:18:16 2012 +0000
+++ b/jdk/src/share/classes/sun/nio/ch/ThreadPool.java Fri Nov 30 16:29:32 2012 +0000
@@ -102,11 +102,7 @@
if (threadFactory == null)
threadFactory = defaultThreadFactory;
// create thread pool
- ExecutorService executor =
- new ThreadPoolExecutor(0, Integer.MAX_VALUE,
- Long.MAX_VALUE, TimeUnit.MILLISECONDS,
- new SynchronousQueue<Runnable>(),
- threadFactory);
+ ExecutorService executor = Executors.newCachedThreadPool(threadFactory);
return new ThreadPool(executor, false, initialSize);
}