ThreadPoolExecutor.setCorePoolSize

Sets the core number of threads. This overrides any value set in the constructor. If the new value is smaller than the current value, excess existing threads will be terminated when they next become idle. If larger, new threads will, if needed, be started to execute any queued tasks.

@param corePoolSize the new core size @throws IllegalArgumentException if {@code corePoolSize < 0} or {@code corePoolSize} is greater than the {@linkplain #getMaximumPoolSize() maximum pool size} @see #getCorePoolSize

class ThreadPoolExecutor
void
setCorePoolSize

Meta