code: public void close() {
          if (running) {
              taskPool.clear();
              running = false;
              for (PoolThread thread : threadPool) {
                  thread.interrupt();
              }
          }
      }
docs: Shutdown the pool of threads