DebuggableThreadPoolExecutor.java 文件源码

java
阅读 47 收藏 0 点赞 0 评论 0

项目:sstable-adaptor 作者:
public DebuggableThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory)
{
    super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue, threadFactory);
    allowCoreThreadTimeOut(true);

    // block task submissions until queue has room.
    // this is fighting TPE's design a bit because TPE rejects if queue.offer reports a full queue.
    // we'll just override this with a handler that retries until it gets in.  ugly, but effective.
    // (there is an extensive analysis of the options here at
    //  http://today.java.net/pub/a/today/2008/10/23/creating-a-notifying-blocking-thread-pool-executor.html)
    this.setRejectedExecutionHandler(blockingExecutionHandler);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号