code: def stopall(self, wait=False):
          
          self.logger.debug("stopall called")
          with self.regcond:
              while self.status != 'up':
                  if self.status in ('stop', 'down') or self.ev_quit.is_set():
                      # For now, silently abandon additional request to stop
                      self.logger.warning("ignoring duplicate request to stop thread pool.")
                      return
  
                  self.logger.debug("waiting for threads: count=%d" %
                                    self.runningcount)
                  self.regcond.wait()
  
              #assert(self.status == 'up')
              self.logger.debug("stopping threads in thread pool")
              self.status = 'stop'
              # Signal to all threads to terminate.
              self.ev_quit.set()
  
              if wait:
                  # Threads are on the way down.  Wait until last one quits.
                  while self.status != 'down':
                      self.logger.debug("waiting for threads: count=%d" %
                                        self.runningcount)
                      self.regcond.wait()
  
              self.logger.debug("stopall done")
docs: Stop all threads in the worker pool.  If _wait_ is True
          then don't return until all threads are down.