Stops all the stoppable threads that haven't already been stopped
961484
public void stopAllThreads()
  {
    if (tc.isEntryEnabled())
      SibTr.entry(tc, "stopAllThreads");
      
    synchronized (this)
    {
      Iterator iterator = ((ArrayList)_threadCache.clone()).iterator();
      while (iterator.hasNext())
      {        
        StoppableThread thread = (StoppableThread)iterator.next();
        
        if (tc.isDebugEnabled())
          SibTr.debug(tc, "Attempting to stop thread " + thread);
        
        // Stop the thread  
        thread.stopThread(this);
        
        // Remove from the iterator
        iterator.remove();
        // Remove from the cache
        _threadCache.remove(thread);          
      }
    }
      
    if (tc.isEntryEnabled())
      SibTr.exit(tc, "stopAllThreads");
  }
1152544
private void stopThreadPool(ExecutorService threadPool) {
        LibraryUtils.checkCondition(threadPool == null, "Thread pool is null when calling stop");

        if (threadPool.isShutdown()) {
            logger.debug(threadPool.toString() + " is already stopped.");

        } else {

            logger.debug(threadPool.toString() + " is about to shutdown.");
            threadPool.shutdown(); // Shutdown thread pool

            try { // Wait for shutdown
                threadPool.awaitTermination(config.getThreadTerminationDelaySeconds(), TimeUnit.SECONDS);
            } catch (InterruptedException e) {
                logger.debug("Wait thread pool termination is interrupted.");
            }

            if (!threadPool.isShutdown()) { // ShutdownNow after waiting
                logger.debug(threadPool.toString() + " is force to shutdown now.");
                threadPool.shutdownNow();
            }

            logger.debug(threadPool.toString() + " is stopped.");
        }
    }
294360
def stop
      @bot.loggers.debug "[Stopping handler] Stopping all threads of handler #{self}: #{@thread_group.list.size} threads..."
      @thread_group.list.each do |thread|
        Thread.new do
          @bot.loggers.debug "[Ending thread] Waiting 10 seconds for #{thread} to finish..."
          thread.join(10)
          @bot.loggers.debug "[Killing thread] Killing #{thread}"
          thread.kill
        end
      end
    end
1121151
public void stop() {
        if (shutdownExecutorOnStop) {
            executor.shutdown(); // Disable new tasks from being submitted
            try {
                // Wait a while for existing tasks to terminate
                if (!executor.awaitTermination(1, TimeUnit.SECONDS)) {
                    executor.shutdownNow(); // Cancel currently executing tasks
                    // Wait a while for tasks to respond to being cancelled
                    if (!executor.awaitTermination(1, TimeUnit.SECONDS)) {
                        System.err.println(getClass().getSimpleName() + ": ScheduledExecutorService did not terminate");
                    }
                }
            } catch (InterruptedException ie) {
                // (Re-)Cancel if current thread also interrupted
                executor.shutdownNow();
                // Preserve interrupt status
                Thread.currentThread().interrupt();
            }
        } else {
            // The external manager(like JEE container) responsible for lifecycle of executor
            synchronized (this) {
                if (this.scheduledFuture == null) {
                    // was never started
                    return;
                }
                if (this.scheduledFuture.isCancelled()) {
                    // already cancelled
                    return;
                }
                // just cancel the scheduledFuture and exit
                this.scheduledFuture.cancel(false);
            }
        }
    }
814425
def stop(self):
        
        assert threading.current_thread() == self.thread
        assert self.state.running
        self.state.running = False
402760
def _stop_thread(self):
        """"""
        self._stopping_event.set()
        queue_content = []
        try:  # give the enqueueing thread chance to put a batch to the queue and check the stopping event
            while True:
                queue_content.append(self._queue.get_nowait())
        except Empty:
            pass
        self._enqueueing_thread.join()
        try:
            queue_content.append(self._queue.get_nowait())  # collect the very last item
        except Empty:
            pass
        self._queue = Queue(max(len(queue_content), self._buffer_size))  # queue content may be bigger than queue size
        for batch in queue_content:
            self._queue.put(batch)
484019
@Override
	public synchronized void stop()
	{
		if (!started)
			return;
		
		bridgeThread.pleaseStop();
		try
		{
			bridgeThread.join();
		}
		catch (InterruptedException e)
		{
			log.error("Wait for bridge thread completion was interrupted");
		}
		finally
		{
			bridgeThread = null;
		}
		
		log.info("["+bridgeDefinition.getName()+"] JMS bridge stopped.");
		started = false;
	}
568686
def stop(self):
        
        if self._handler is not None:
            sys.settrace(self._previous)
            self._handler = self._previous = None
            if self.threading_support is None or self.threading_support:
                threading.settrace(self._threading_previous)
                self._threading_previous = None
1154268
def stop(self):
        
        if self._io_thread is not None:
            self.log.info("Waiting for I/O thread to stop...")
            self.closed = True
            self._io_thread.join()

        if self._writer_thread is not None:
            self.log.info("Waiting for Writer Thread to stop...")
            self.closed = True
            self._writer_thread.join()

        self.log.info("All worker threads stopped.")
380064
public final void stop() {
        if (this.thread != null) {
            try {
                if (this.thread != null) {
                    this.thread.interrupt();
                    synchronized (this.thread) {
                        this.thread.notifyAll();
                    }
                }
            } finally {
                this.thread = null;
            }
        }
    }
458085
public final void stop() {
        SystemException finalException = null;

        try {
            _interlock.await();
        } catch (InterruptedException ex) {
            Thread.currentThread().interrupt();
        } finally {
            try {
                if (_unlocked) {
                    _log.info("Stopping {}.", getName());
                    doStop();
                }
            } catch (Exception ex) {
                finalException = new SystemException(ex);
            } finally {
                _started = false;
            }
        }
        if (finalException != null) {
            throw finalException;
        }
    }
1330659
public synchronized void stop() {
        if (listenerThreads.size() > 0) {
            for (MulticastSocketListenerThread thread : listenerThreads) {
                thread.shutdown();
            }
        }

        listenerThreads.clear();
    }
223756
def thread_stopped(self):
		
		if self.__task is not None:
			if self.__task.stop_event().is_set() is False:
				self.__task.stop()
			self.__task = None
819218
public synchronized void stop() {
		// Mark us closed
		stopped = true;
		try {
			// Kick the server accept loop
			serverSocket.close();

			// acquire all semaphores so that we wait for all connections to finish before we report back as closed
			semaphore.acquireUninterruptibly(MAXIMUM_CONCURRENT_READERS);
		} catch (IOException e) {
			log.log(Level.SEVERE, "Caught exception: ", e);
		}
	}
934198
def stop(self):
        
        log.debug("Stopping listeners")
        self.queue_lock.acquire()
        for s in self.listeners:
            log.debug("Stopping {}".format(s))
            s.shutdown()
            s.socket.close()
        self.cancel_queue()
        for t in self.threads:
            t.join()
        self.listeners = []
        self.threads = []
        self.is_running = False
        self.queue_lock.release()
        log.debug("Listeners stopped and threads joined")
569090
public synchronized void stop() {
    if (!mStopped) {
      mLoggingWorkerThread.interrupt();
      try {
        mLoggingWorkerThread.join();
      } catch (InterruptedException e) {
        Thread.currentThread().interrupt();
      } finally {
        mStopped = true;
        mLoggingWorkerThread = null;
        LOG.info("AsyncUserAccessAuditLogWriter thread stopped.");
      }
    }
  }
326924
public synchronized void stopThread()
	{
		if (isRunning())
		{
			if (log.isInfoEnabled())
				log.info("[Daemon] {stopThread} Requesting termination of thread " + thisThread.getName());

			this.running = false;

			synchronized (this)
			{
				this.notifyAll();
			}
		}
		else
		{
			throw new IllegalThreadStateException("Daemon must be started before it may be stopped.");
		}
	}