ExecutorService threadPool = new ThreadPoolExecutor(2, 5,
1L, TimeUnit.SECONDS,
new LinkedBlockingQueue<>(3),
Executors.defaultThreadFactory(),
new ThreadPoolExecutor.AbortPolicy());
threadPool.execute(() -> {
//---------线程执行内容
});
threadPool.shutdown();
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)