提交 7d3c6dd1 编写于 作者: oldratlee's avatar oldratlee 🔥

use daemon thread for test

上级 9e9bcc53
......@@ -16,11 +16,13 @@ private const val POOL_SIZE = 3
* @see com.alibaba.ttl.threadpool.agent.internal.transformlet.impl.TtlExecutorTransformlet
*/
fun main(args: Array<String>) {
val threadFactory = ThreadFactory { Thread(it).apply { isDaemon = true } }
val executorService = ThreadPoolExecutor(POOL_SIZE, POOL_SIZE,
10L, TimeUnit.SECONDS,
LinkedBlockingQueue())
LinkedBlockingQueue(), threadFactory)
val scheduledExecutorService = ScheduledThreadPoolExecutor(POOL_SIZE)
val scheduledExecutorService = ScheduledThreadPoolExecutor(POOL_SIZE, threadFactory)
expandThreadPool(executorService)
expandThreadPool(scheduledExecutorService)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册