public void adjustPoolSize(int newPoolSize) {
        if (newPoolSize != poolSize) {
            poolSize = newPoolSize;
            if (executor instanceof ThreadPoolExecutor) {
                ThreadPoolExecutor pool = (ThreadPoolExecutor) executor;
                pool.setCorePoolSize(newPoolSize);
                pool.setMaximumPoolSize(newPoolSize);
            }
        }
    }
public void adjustPoolSize ( int newPoolSize ) { if ( newPoolSize != poolSize ) { poolSize = newPoolSize ; if ( executor instanceof ThreadPoolExecutor ) { ThreadPoolExecutor pool = ( ThreadPoolExecutor ) executor ; pool . setCorePoolSize ( newPoolSize ) ; pool . setMaximumPoolSize ( newPoolSize ) ; } } }
调整一下线程池