code: void resetThreadPool() {
          if (threadPool == null)
              return; // if no pool (during shutdown), nothing to retune/reset
  
          // 8/22/2012: Introduced factor - was hard coded at 2
          final int availableProcessors = NUMBER_CPUS;
  
          int factor = 2500 * availableProcessors / Math.max(1, (int) previousThroughput);
          factor = Math.min(factor, 4);
          factor = Math.max(factor, 2);
          int newThreads = Math.min(factor * availableProcessors, maxThreads);
          newThreads = Math.max(newThreads, coreThreads);
  
          targetPoolSize = newThreads;
          setPoolSize(newThreads);
  
          resetStatistics(true);
      }
docs: Reset all statistics associated with the thread pool and reset the pool
  size to a value that's based on the number of hardware threads available
  to the JVM.