mirror of
https://github.com/alibaba/p3c.git
synced 2025-10-16 08:02:12 +00:00
@@ -107,7 +107,7 @@ Positive example 3:
|
|||||||
.setNameFormat("demo-pool-%d").build();
|
.setNameFormat("demo-pool-%d").build();
|
||||||
ExecutorService singleThreadPool = new ThreadPoolExecutor(1, 1,
|
ExecutorService singleThreadPool = new ThreadPoolExecutor(1, 1,
|
||||||
0L, TimeUnit.MILLISECONDS,
|
0L, TimeUnit.MILLISECONDS,
|
||||||
new LinkedBlockingQueue<Runnable>(1024), namedThreadFactory, new ThreadPoolExecutor.AbortPolicy());
|
new LinkedBlockingQueue<Runnable>(1024), namedThreadFactory, new ThreadPoolExecutor.AbortPolicy());
|
||||||
|
|
||||||
singleThreadPool.execute(()-> System.out.println(Thread.currentThread().getName()));
|
singleThreadPool.execute(()-> System.out.println(Thread.currentThread().getName()));
|
||||||
singleThreadPool.shutdown();
|
singleThreadPool.shutdown();
|
||||||
|
Reference in New Issue
Block a user