Cancel the watchdog task and related variables.
970211
async def cancel_watchdog(self):
        """"""
        if self._watchdog_task is not None:
            _LOGGER.debug("Canceling Watchdog task.")
            self._watchdog_task.cancel()
            try:
                await self._watchdog_task
            except asyncio.CancelledError:
                self._watchdog_task = None
178649
def task_del(self, t):
        
        name = t._name
        if name in self._tasknames:
            del self._tasknames[name]
        self._tasks.discard(t)
        self._tasks_scoped.discard(t)
        try:
            t.stop()
        except:
            log = self._params.get('log', self._discard)
            log.error("Failed to stop processes for task %r -- %s", name, e, exc_info=log.isEnabledFor(logging.DEBUG))
        for pid in t.get_pids():
            self.proc_del(pid)
976391
def cancel():
  
  task_id = request.form['id']
  task = Task.query.get(task_id)

  if not task:
    return json.dumps({
      'status': 'success',
      'id': None,
    })

  task.delete()

  if task.active:
    current_app.scheduler.cancel(task_id)

    code = task.code
    other_task = Task.query.filter_by(code=code).order_by('interval').first()
    if other_task:
      other_task.active = True
      other_task.save()
      current_app.scheduler.schedule({
        'id': other_task.id,
        'code': other_task.code,
        'interval': other_task.interval
      })

  return json.dumps({
    'status': 'success',
    'id': task_id,
  })
141769
def stop_running_tasks(self):
		
		for task in self.__running_registry:
			task.stop()
		self.__running_registry.clear()
1278926
def stop(self):
        """"""
        if self.running and self.num_workers:
            for worker in self.workers:
                self.queue.put(None)
            for worker in self.workers:
                worker.join()
            # Free up references held by workers
            del self.workers[:]
            self.queue.join()
        self.running = False
948016
def cleanup(self, sched, coro):
        """"""
        try:
            sched.sigwait[self.name].remove((self, coro))
        except ValueError:
            pass
        return True
598584
async def shutdown(sig, loop):
    """"""
    logging.info(f'Received exit signal {sig.name}...')
    tasks = [task for task in asyncio.Task.all_tasks() if task is not
             asyncio.tasks.Task.current_task()]

    for task in tasks:
        logging.debug(f'Cancelling task: {task}')
        task.cancel()

    results = await asyncio.gather(*tasks, return_exceptions=True)
    logging.debug(f'Done awaiting cancelled tasks, results: {results}')

    loop.stop()
    logging.info('Shutdown complete.')
980520
public function cancelCheckOut()
    {
        $this->getBinding()->getVersioningService()->cancelCheckOut($this->getRepositoryId(), $this->getId());

        $this->getSession()->removeObjectFromCache($this);
    }
1298614
def stop(self):
        """"""
        with self._lock_c:
            for task in self.taskset:
                try:
                    task.stop()

                except TaskError as e:
                    # Task does not have a way to stop it.
                    # TODO: notify who?
                    pass
362472
public function cancel_process() {
		if ( ! $this->is_queue_empty() ) {
			$batch = $this->get_batch();

			$this->delete( $batch->key );

			wp_clear_scheduled_hook( $this->cron_hook_identifier );
		}

	}
1118048
def stopdocs():
    ""
    for i in range(4):
        pid = watchdog_pid()
        if pid:
            if not i:
                sh('ps {}'.format(pid))
            sh('kill {}'.format(pid))
            time.sleep(.5)
        else:
            break
633321
public void cancelAllReservations() {
    // Inform jobs which have reserved slots on this tasktracker
    if (jobForFallowMapSlot != null) {
      unreserveSlots(TaskType.MAP, jobForFallowMapSlot);
    }
    if (jobForFallowReduceSlot != null) {
      unreserveSlots(TaskType.REDUCE, jobForFallowReduceSlot);
    }
  }
1350683
protected void cancelScheduledTasks() {
        assert inEventLoop();
        PriorityQueue<ScheduledFutureTask<?>> scheduledTaskQueue = this.scheduledTaskQueue;
        if (isNullOrEmpty(scheduledTaskQueue)) {
            return;
        }

        final ScheduledFutureTask<?>[] scheduledTasks =
                scheduledTaskQueue.toArray(new ScheduledFutureTask<?>[0]);

        for (ScheduledFutureTask<?> task: scheduledTasks) {
            task.cancelWithoutRemove(false);
        }

        scheduledTaskQueue.clearIgnoringIndexes();
    }
119604
async def stop(self):
        
        for task in self.__tracks.values():
            if task is not None:
                task.cancel()
        self.__tracks = {}
980290
private void cancelScan() {
        if (cleanTask != null) {
            cleanTask.cancel(true);
            cleanTask = null;
        }
        client.close();
    }
695473
def stop(self):
        
        self.shutdown.set()

        for monitor in self.observers:
            monitor.stop()

        self.wind_down()

        for monitor in self.observers:
            monitor.join()

        for thread in self.thread_pool.values():
            thread.join()

        self.work_pool.shutdown()
260924
public void stopChecking() {
        // synchronize with other attempts to update the running task
        synchronized(runningTaskLock){
            if(runningTask != null) {
                // cancel task (let it complete its current run if running)
                runningTaskFuture.cancel(false);
                // log
                LOGGER.debug("Stop criterion checker for search {} deactivated", search);
                // discard task
                runningTask = null;
                runningTaskFuture = null;
            }
        }
    }