code: def close(self):
          
          with self._lock:
              if self._closing:
                  return
              self._closing = True
              if not self._workers:
                  self._closed.set()
                  return
              self._queue.put_nowait(self._PoolClosing)
          self._closed.wait()
docs: Close the pool and wait for all workers to exit.
  
          New submissions will be blocked. Workers will exit once their current
          job is finished. This method will return after all workers have exited.