changeset 22509:8542dc50f64c

use the Executors factory method to create a fixed thread pool
author Benoit Daloze <benoit.daloze@jku.at>
date Wed, 26 Aug 2015 11:11:27 +0200
parents 37382f5ba566
children d3d19b31e9a4
files graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/HotSpotTruffleRuntime.java
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/HotSpotTruffleRuntime.java	Wed Aug 26 10:56:02 2015 +0200
+++ b/graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/HotSpotTruffleRuntime.java	Wed Aug 26 11:11:27 2015 +0200
@@ -77,7 +77,7 @@
     }
 
     private Map<OptimizedCallTarget, Future<?>> compilations = newIdentityMap();
-    private final ThreadPoolExecutor compileQueue;
+    private final ExecutorService compileQueue;
 
     private final Map<RootCallTarget, Void> callTargets = Collections.synchronizedMap(new WeakHashMap<RootCallTarget, Void>());
     private static final long THREAD_EETOP_OFFSET = eetopOffset();
@@ -111,8 +111,7 @@
             }
         }
         selectedProcessors = Math.max(1, selectedProcessors);
-        compileQueue = new ThreadPoolExecutor(selectedProcessors, selectedProcessors, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(), factory);
-
+        compileQueue = Executors.newFixedThreadPool(selectedProcessors, factory);
     }
 
     @Override