ThreadPoolExecutor

demo:

public class ThreadPoolExecutorTest {
    public static void main(String[] args) {
        Thread t = new Thread(() -> System.out.println("start..."));
        ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(1, 2, 1000L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue());
        threadPoolExecutor.execute(t);
    }
}

 

 

 

 

分析:

 

posted @ 2021-06-17 19:34  圣金巫灵  阅读(41)  评论(0编辑  收藏  举报