setMaximumPoolSize

fun setMaximumPoolSize(maximumPoolSize: Int)

Sets the maximum allowed 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.

Parameters

maximumPoolSize

the new maximum

See also

.getMaximumPoolSize

Throws

if the new maximum is less than or equal to zero, or less than the .getCorePoolSize