Terminate the child process.

        It is not an error to call this method when the child has already exited.
11032
def terminate(self):
        
        try:
            self.send_signal(signal.SIGTERM)
        except pyuv.error.ProcessError as e:
            if e.args[0] != pyuv.errno.UV_ESRCH:
                raise
426837
public final void end() {
    final Thread thread = threadRef;
    if (thread != null) {
      thread.interrupt();
      try {
        thread.join();
      } catch (InterruptedException e) {
        Thread.currentThread().interrupt();
      }
    }
    this.threadRef = null;
  }
469943
def _TerminateProcessByPid(self, pid):
    
    self._RaiseIfNotRegistered(pid)

    process = self._processes_per_pid[pid]

    self._TerminateProcess(process)
    self._StopMonitoringProcess(process)
535710
public void terminate() throws InterruptedException, IOException {
        final Computer computer = toComputer();
        if (computer != null) {
            computer.recordTermination();
        }
        try {
            // TODO: send the output to somewhere real
            _terminate(new StreamTaskListener(System.out, Charset.defaultCharset()));
        } finally {
            try {
                Jenkins.get().removeNode(this);
            } catch (IOException e) {
                LOGGER.log(Level.WARNING, "Failed to remove "+name,e);
            }
        }
    }
959165
public void terminate() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(tc, "terminate");
        }

        AsyncLibrary.shutdown();
        groups.clear();

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(tc, "terminate");
        }
    }
594614
public void terminate() {
    if (!isTerminated()) {
      for (final Stage stage : stages.values()) {
        stage.stop();
      }

      loggerProviderKeeper.close();
      mailboxProviderKeeper.close();
      completesProviderKeeper.close();
    }
  }
1336088
public function killChild()
	{
		if(!$this->child) {
			$this->logger->log(Psr\Log\LogLevel::DEBUG, 'No child to kill.');
			return;
		}

		$this->logger->log(Psr\Log\LogLevel::INFO, 'Killing child at {child}', array('child' => $this->child));
		if(exec('ps -o pid,state -p ' . $this->child, $output, $returnCode) && $returnCode != 1) {
			$this->logger->log(Psr\Log\LogLevel::DEBUG, 'Child {child} found, killing.', array('child' => $this->child));
			posix_kill($this->child, SIGKILL);
			$this->child = null;
		}
		else {
			$this->logger->log(Psr\Log\LogLevel::INFO, 'Child {child} not found, restarting.', array('child' => $this->child));
			$this->shutdown();
		}
	}
646015
protected final void terminate() {
		if (rebind(connection)) {
			if (log.isTraceEnabled()) {
				log.trace(format(channel(), "Disposing ChannelOperation from a channel"),
						new Exception("ChannelOperation terminal stack"));
			}

			Operators.terminate(OUTBOUND_CLOSE, this);
			// Do not call directly inbound.onInboundComplete()
			// HttpClientOperations need to notify with error
			// when there is no response state
			onInboundComplete();
			if (channel().isActive() && isPersistent()) {
				channel().writeAndFlush(TERMINATED_OPS, this);
			}
			else {
				// Returned value is deliberately ignored
				setSuccess(null);
			}
		}
	}
241821
def kill_child_processes() -> None:
    
    timeout_sec = 5
    for p in processes:
        try:
            p.wait(timeout_sec)
        except TimeoutExpired:
            # failed to close
            p.kill()
845856
def terminate(self):
        
        rs = self.connection.terminate_instances([self.id])
        if len(rs) > 0:
            self._update(rs[0])
1295300
def stop(self) -> None:
        
        if not self.running:
            return
        try:
            self.wait(timeout_s=0)
            # If we get here: stopped already
        except subprocess.TimeoutExpired:  # still running
            for kill_level in self.ALL_KILL_LEVELS:
                tried_to_kill = self._terminate(level=kill_level)  # please stop
                if tried_to_kill:
                    try:
                        self.wait(timeout_s=self.kill_timeout_sec)
                        break
                    except subprocess.TimeoutExpired:  # failed to close
                        self.warning("Subprocess didn't stop when asked")
                        pass  # carry on escalating
        self.close_logs()
        self.running = False
562401
def terminate(self):
        
        self.handle, handle = None, self.handle
        if threading.current_thread() is self._event_thread:
            # Handle special case to allow event handle to be detached.
            # This is necessary since otherwise the event thread would deadlock itself.
            grim_reaper = threading.Thread(target=lambda: _mpv_terminate_destroy(handle))
            grim_reaper.start()
        else:
            _mpv_terminate_destroy(handle)
            if self._event_thread:
                self._event_thread.join()
978980
def stop_process(process):
    """"""
    process.terminate()
    process.join(3)

    if process.is_alive() and os.name != 'nt':
        try:
            os.kill(process.pid, signal.SIGKILL)
            process.join()
        except OSError:
            return

    if process.is_alive():
        raise RuntimeError("Unable to terminate PID %d" % os.getpid())
1273678
public void terminate()
	{
		log( "term" );

		fActivated = false;
		converter = null;

		source.removePropertyChangedHandler( sourceHandler );
		source = null;
		sourceHandler = null;

		destination.removePropertyChangedHandler( destinationHandler );
		destination = null;
		destinationHandler = null;

	}
426141
def kill(self):
        
        if self.process:
            self.process.kill()
            self.process.wait()
1211258
def close(self):
        ''''''
        self.close_window.set()
        if self.child.is_alive():
            self.child.join(1)

        self.child.terminate()

        self.event_queue_lock.acquire()
        self.event_queue.put(MissionEditorEvent(me_event.MEE_TIME_TO_QUIT));
        self.event_queue_lock.release()
485128
def kill_mprocess(process):
    
    if process and proc_alive(process):
        process.terminate()
        process.communicate()
    return not proc_alive(process)