Stops all active threads and rejects new tasks to be added
        Args:
            block (bool): If True, block until all threads are closed
555115
def stop(self, block=True):
        
        self._stop = True

        # Removing tasks in queue
        self.empty_queue()

        # All active threads
        # With the DoNothing function
        # Because self._stop is True each thread will process at most one of the DoNothing functions
        # Hence it is ensured that all .get calls are triggered
        for _ in range(self.threads_active()):
            self._queue.put(SetPrio(target=DoNothing))

        if block:
            # Blocking until all threads are closed
            self.join()

            # Removing any leftover DoNothing functions (Can only be reliably done when all threads are closed)
            self.empty_queue()
1080
public void stop() {
        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)) {
                    LOG.warn(getClass().getSimpleName() + ": ScheduledExecutorService did not terminate");
                }
            }
        } catch (InterruptedException ie) {
            // (Re-)Cancel if current thread also interrupted
            executor.shutdownNow();
            // Preserve interrupt status
            Thread.currentThread().interrupt();
        }
    }
659715
async def stop(self) -> None:
        """"""
        if not self._is_running:
            raise SublemonRuntimeError(
                'Attempted to stop an already-stopped `Sublemon` instance')

        await self.block()
        self._poll_task.cancel()
        self._is_running = False
        with suppress(asyncio.CancelledError):
            await self._poll_task
126620
def lock(self, block=True):
		
		self._locked = True
		return self._lock.acquire(block)
959845
def stop(self) -> None:
        

        self._shutdown = True

        # Close connection if needed
        self._protocol.close()

        # Cancel any pending tasks
        self.cancel_pending_tasks()
1185088
def stop(self):
        
        for p in self.primitives[:]:
            p.stop()

        StoppableLoopThread.stop(self)
452881
def stop(self):
        
        self._running = False
        if self._self_thread is not None:
            self._self_thread.cancel()
            self._self_thread = None
867647
def Close(self, abort=False):
    
    if abort:
      # Prevent join_thread() from blocking.
      self._queue.cancel_join_thread()

    self._queue.close()
    self._queue.join_thread()
314522
def __stopOpenThreadWpan(self):
        
        print 'call stopOpenThreadWpan'
        try:
            if self.__sendCommand(WPANCTL_CMD + 'leave')[0] != 'Fail' and self.__sendCommand(WPANCTL_CMD + 'dataset erase')[0] != 'Fail':
                return True
            else:
                return False
        except Exception, e:
            ModuleHelper.WriteIntoDebugLogger('stopOpenThreadWpan() Error: ' + str(e))
1231036
def _stop(self):
        
        if self._started.isSet():
            # join threads
            self._pool_getter.join()
            self._pool_putter.join()
            for worker in self.pool:
                worker.join()
            # remove threads  
            del self._pool_putter
            del self._pool_getter
            del self.pool
            # remove results
            self._tasks = []
            self._tasks_tracked = {}
            # virgin variables
            self._stopping.clear()
            self._started.clear()
181549
def disable(self, threads=True):
        
        if self.enabled_start:
            sys.settrace(None)
            self._disable()
        else:
            warn('Duplicate "disable" call')
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
1035407
def stop_server(self):
        
        self.stop = True
        while self.task_count:
            time.sleep(END_RESP)
        self.terminate = True
1114368
synchronized public void stop() {
    process = false;
    BlockEncodeRequest temp = new BlockEncodeRequest();
    temp.setAll(null, -1, -1, -1, -1, null);
    int count = frameThreadMap.size();
    for(int i = 0; i < count; i++) {
      unassignedEncodeRequests.add(temp);
    }
  }
1035705
def terminate_with_threads(self, nodes=None):
        
        if not self.is_connected():
            return None

        nodes = nodes or self.nodes
        failed_kill = []

        def worker(gce, node):
            self.logger.info("Terminating node: %s", node.name)
            terminated = gce.destroy_node(node)
            if not terminated:
                failed_kill.append(node)

        threads = []
        for node in nodes:
            thread = threading.Thread(target=worker, args=(self.gce, node))
            threads.append(thread)
            thread.start()

        self.logger.info("Waiting for nodes to shut down ...")
        for thread in threads:
            thread.join()

        return failed_kill
258346
def halt(self):
        
        if self._callback:
            self._thread_continue = False
            self._thread.join()
719450
def blocks(self, ignore_blank_lines=True):
        
        start, end = self.get_range(ignore_blank_lines=ignore_blank_lines)
        block = self._trigger.next()
        while block.blockNumber() <= end and block.isValid():
            yield block
            block = block.next()