ThreadPoolExecutor.CallerRunsPolicy()相关问题问题
ThreadPoolExecutor threadPool =
new ThreadPoolExecutor(2, 4,3,TimeUnit.SECONDS, new ArrayBlockingQueue(3),new ThreadPoolExecutor.CallerRunsPolicy());
我定义的最大线程数是4个,但是为什么会有5个线程启动(先启动2个,然后队列里加3个任务,接下来启动了3个线程)???
[解决办法]