package com.uas.platform.b2b.manage.support;

import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @author hejq
 * @date 2018-07-27 17:56
 */
public class MyThreadPoolExecutor {

    /**
     * 核心线程数
     */
    static final int corePoolSize = 5;

    /**
     * 最大线程
     */
    static final int maxmunPoolSize = 10;

    /**
     * 回收空闲线程时间间隔
     */
    static final int keepAliveTime = 60;

    /**
     * 自定义线程
     */
    public static ThreadPoolExecutor executor = new ThreadPoolExecutor(
            corePoolSize,
            maxmunPoolSize,
            keepAliveTime,
            TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(),
            new MyThread(),
            new ThreadPoolExecutor.AbortPolicy());
}
