Here you can find the source of createPool(int threads, int queueSize)
static ExecutorService createPool(int threads, int queueSize)
//package com.java2s; //License from project: Open Source License import java.util.concurrent.*; public class Main { static ExecutorService createPool(int threads, int queueSize) { return new ThreadPoolExecutor(1, threads, 30, TimeUnit.SECONDS, new LinkedBlockingDeque<>(queueSize), new ThreadPoolExecutor.CallerRunsPolicy()); }/*from w w w . j a v a 2 s . c o m*/ }