'Adjust the number of available threads by setting C{min} and C{max} to
new values.
@param minthreads: The new value for L{ThreadPool.min}.
@param maxthreads: The new value for L{ThreadPool.max}.'

def adjustPoolsize(self, minthreads=None, maxthreads=None):

    if (minthreads is None):
        minthreads = self.min
    if (maxthreads is None):
        maxthreads = self.max
    assert (minthreads >= 0), 'minimum    is    negative'
    assert (minthreads <= maxthreads), 'minimum    is    greater    than    maximum'
    self.min = minthreads
    self.max = maxthreads
    if (not self.started):
        return
    if (self.workers > self.max):
        self._team.shrink((self.workers - self.max))
    if (self.workers < self.min):
        self._team.grow((self.min - self.workers))
