changeset 6199:c370048be8fc

7165762: (aio) Default thread pool should be configured so that threads terminated after a timeout period Reviewed-by: chegar
author alanb
date Fri, 30 Nov 2012 16:29:32 +0000
parents 72d3d07b625d
children e7edb0da9c6a
files src/share/classes/sun/nio/ch/ThreadPool.java
diffstat 1 files changed, 1 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/sun/nio/ch/ThreadPool.java	Fri Nov 30 11:18:16 2012 +0000
+++ b/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);
     }