Closes all thread queues.

 === Return
 result(Boolean):: true if any queues are still active (and stopping)
773163
def close_thread_queues
      still_active = false
      @mutex.synchronize do
        @thread_name_to_queue.each_value do |queue|
          if queue.active?
            queue.close
            still_active = true
          end
        end
      end
      return still_active
    end
1063003
def close(self):
        '''
        '''
        if not self.closed:
            waiters = []
            queue = self._queue
            while queue.qsize():
                connection = queue.get_nowait()
                if connection:
                    closed = connection.close()
                    if closed:
                        waiters.append(closed)
            in_use = self._in_use_connections
            self._in_use_connections = set()
            for connection in in_use:
                if connection:
                    waiters.append(connection.close())
            self._closed = asyncio.gather(*waiters, loop=self._loop)
        return self._closed
549103
def close_thread_handles(self):
        
        for aThread in self.iter_threads():
            try:
                aThread.close_handle()
            except Exception:
                try:
                    e = sys.exc_info()[1]
                    msg = "Cannot close thread handle %s, reason: %s"
                    msg %= (aThread.hThread.value, str(e))
                    warnings.warn(msg)
                except Exception:
                    pass
395526
def is_closing(self) -> bool:
        
        return self.stream.closed() or self.client_terminated or self.server_terminated
278778
def stop(self):
        

        # Stopping the server will cause its `serve_forever()` method
        # to return, which will cause the server thread to terminate.
        # TODO: Describe how the processing threads terminate.

        if self._http_server:
            self._http_server.shutdown()
            self._http_server.server_close()
            self._http_server = None
            self._http_thread = None

        if self._https_server:
            self._https_server.shutdown()
            self._https_server.server_close()
            self._https_server = None
            self._https_thread = None
452881
def stop(self):
        
        self._running = False
        if self._self_thread is not None:
            self._self_thread.cancel()
            self._self_thread = None
630642
def close(self):
    
    if not self.closed:
      self.closed = True
      self._flush(finish=True)
      self._buffer = None
225187
def close(self):
        
        if not self._closed:
            self._closed = True
            if self._pool is not None:
                self._pool.close()
                self._pool = None
34049
def (self):
        
        while True:
            message = self.res_queue.get()
            if message is None:
                _logger.debug(" thread is terminated")
                return
            self._(message)
207193
def close(self):
        
        if self.is_closing():
            return

        self._closing = True
        # make sure the writer wakes up
        self._can_write.set()
637305
def close(self):
        
        self._wr_lock.acquire()
        self._rd_lock.acquire()
        try:
            self._running.clear()
            if self.socket:
                self._close_socket()
            if self._inbound_thread:
                self._inbound_thread.join(timeout=self._parameters['timeout'])
            self._inbound_thread = None
            self.poller = None
            self.socket = None
        finally:
            self._wr_lock.release()
            self._rd_lock.release()
814425
def stop(self):
        
        assert threading.current_thread() == self.thread
        assert self.state.running
        self.state.running = False
853125
def close(self):
        
        if not self.closable:
            LOGGER.warning('Closed called while %s', self.state_description)
            raise ConnectionStateError(self.state_description)
        self.state = self.STATE_CLOSING
        LOGGER.info('Closing RabbitMQ connection')
        self.connection.close()
1032999
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")
1337178
def close(self):
        
        try:
            self._running = False
            self._read_thread.stop()
            self._device.close()

        except Exception:
            pass

        self.on_close()
979784
@Override
  public void close() {

    if (closed.compareAndSet(false, true) && numThreads > 0) {

      LOG.log(Level.FINEST, "Closing ThreadPoolStage {0}: begin", this.name);

      executor.shutdown();

      boolean isTerminated = false;
      try {
        isTerminated = executor.awaitTermination(SHUTDOWN_TIMEOUT, TimeUnit.MILLISECONDS);
      } catch (final InterruptedException ex) {
        LOG.log(Level.WARNING, "Interrupted closing ThreadPoolStage " + this.name, ex);
      }

      if (!isTerminated) {
        final List<Runnable> droppedRunnables = executor.shutdownNow();
        LOG.log(Level.SEVERE,
            "Closing ThreadPoolStage {0}: Executor did not terminate in {1} ms. Dropping {2} tasks",
            new Object[] {this.name, SHUTDOWN_TIMEOUT, droppedRunnables.size()});
      }

      if (!executor.isTerminated()) {
        LOG.log(Level.SEVERE, "Closing ThreadPoolStage {0}: Executor failed to terminate.", this.name);
      }

      LOG.log(Level.FINEST, "Closing ThreadPoolStage {0}: end", this.name);
    }
  }
796659
def close(self):
        
        if not self._closed:
            self._closed = True
            self._stop_multi_pools()
            if self._http_pool is not None:
                self._http_pool.clear()
                self._http_pool = None
            if self._tcp_pool is not None:
                self._tcp_pool.clear()
                self._tcp_pool = None