code: public void setMaxWorkers(int maxWorkers) {
      synchronized (workerQueue) {
        idleLock.lock();
        try {
          int oldMaxWorkers = this.maxWorkers;
          this.maxWorkers = maxWorkers;
  
          // If the number of workers is being reduced, then signal any
          // waiting workers so that they can terminate themselves if
          // their id is greater than the number of workers, and so that
          // another worker can take over idle polling if the current
          // polling worker is to be terminated.
          if (maxWorkers < oldMaxWorkers) {
            idleComplete.signalAll();
          }
        } finally {
          idleLock.unlock();
        }
        while (numWorkers < maxWorkers) {
          String title = String.format("Worker (%d)", numWorkers + 1);
          ProgressMonitorWrapper monitor = new ProgressMonitorWrapper(numWorkers++, monitorFactory.createProgressMonitor(title));
          workerQueue.add(new Worker(monitor));
        }
      }
    }
docs: Sets the maximum number of concurrent workers.
  @param maxWorkers The maximum number of concurrent workers.