Stop the process.
 @param [Block] will execute prior to shutdown, if given.
544921
def stop(&block)
      block.call('stop') unless block.nil?
      pid = read_pid
      fail 'No valid PID file.' unless pid && pid > 0
      Process.kill('TERM', pid)
      delete_pid
      puts 'Process terminated.'
    end
1079803
def stop
      if(@runner.nil? && @stop)
        raise NotRunning.new
      elsif(@runner.nil? || !@runner.alive?)
        @stop = true
        @runner = nil
      else
        @stop = true
        if(@runner)
          @runner.raise Resync.new if @runner.alive? && @runner.stop?
          @runner.join(0.05) if @runner
          @runner.kill if @runner && @runner.alive?
        end
        @runner = nil
      end
      nil
    end
1285635
public void stop() {
		if (LOG.isInfoEnabled()) {
			LOG.info("Esper statement [" + epl + "] being stopped");
		}

		this.epStatement.stop();

		if (LOG.isInfoEnabled()) {
			LOG.info("Esper statement [" + epl + "] stopped");
		}
	}
430724
def resume
        if @paused_block
          halted, error = callcc do |block|
            @resume_block = block
            @paused_block.call
          end
          
          @resume_block = @paused_block = nil
          
          raise error if error
          !halted
        else
          true
        end
      end
1073767
def stop
      if config.managed? && started?
        Process.kill 'HUP', pid

        # Wait for fcrepo to stop
        while status
          sleep 1
        end

        Process.waitpid(pid)
      end

      @pid = nil
    end
83579
public function shutdown($block = true, $signal = SIGTERM)
    {
        if (empty($this->pid)) {
            throw new \LogicException('the process pid is null, so maybe the process is not started');
        }
        if (!$this->isRunning()) {
            throw new \LogicException("the process is not running");
        }
        if (!posix_kill($this->pid, $signal)) {
            throw new \RuntimeException("kill son process failed");
        }

        $this->updateStatus($block);
    }
841186
def stop(self):
        """"""
        self._end.value = True
        if self.background_process:
            try:
                self.background_process.terminate()
            except Exception:
                pass
        for task_id, values in self.current_tasks.items():
            try:
                values['proc'].terminate()
            except Exception:
                pass
1146188
def stop &block
      if block_given? then
        @stopped = true
        @suspended = false
        # Wait till something is put on the dead queue...
        # This stops us from acquiring the mutex until after @thread
        # has processed @stopped set to true.
        sig = @dead.deq
        # The cron thread should be dead now, or wrapping up (with the
        # acquired mutex)... 
        @mutex.synchronize {
          while @thread.alive?
            sleep 0.2
          end
          block.call(self)
        }
      end
    end
1312192
def stop(self):
        
        self.stopped_by_interrupt = True

        if self.executor:
            self.executor.stop()
753393
def stop
      if @pid
        begin
          debug "Asking Foreman to terminate... (#{@pid})"
          ::Process.kill("TERM", @pid)
          debug "Waiting for Foreman to stop..."
          ::Process.waitpid(@pid)
          @pid = nil          # Unset @pid
        rescue Errno::ESRCH
          # Don't do anything, the process does not exist
          debug "Could not find Foreman process"
        end
        info "Foreman stopped."
      end
    end
861253
def stop(opts = {})
      mutex.synchronize do
        check_process!

        log(:debug) { "Stop on #{uri}..." }

        connection.release
        connection.delete if opts[:delete]
        connection.close
        dispatcher.shutdown

        reset
      end
    end
876761
public void stop() {
        if (future != null) {
            future.cancel(true);
        }
        if (executor != null) {
            executor.shutdownNow();
        }
    }
654112
def stop config={}
      @config.update(config).update(load_config)
      # @config = (config.empty?) ? load_config : config
      yield(self) if block_given?
      __stop! if respond_to?(:__stop!)
      pidfile = get_pidfile(@config)
      log 'No such process' and exit unless pidfile.pid
      begin
        log "Sending TERM signal to process #{pidfile.pid}"
        Process.kill("TERM", pidfile.pid)
      rescue
        log 'Could not find process'
      ensure
        pidfile.remove
      end
      
    end
1225199
def stop

      if running?

        Process.kill(@signal, @pid)
        FileUtils.rm(@pid_file)

        execute_callback(:stop)

        begin
          Process.wait(@pid)
        rescue Errno::ECHILD
        end

        @timeout.downto(0) do
          sleep 1
          exit unless running?
        end

        Process.kill 9, @pid if running?
        execute_callback(:after_stop)

      else
        FileUtils.rm(@pid_file) if File.exists?(@pid_file)
        log(:info, "\"#{@name}\" PID file not found.")
      end

    rescue Errno::ENOENT
    end
959010
def shutdown(self, skip_hooks=False):
        

        if not self._exited:
            self._exited = True

            if not skip_hooks:
                self._run_events(shutdown=True)

            _shutdown_pipe(self._pipe)
            self._task.stop()
            raise SystemExit
45768
public void cancel() {

    this.stateLock.lock();

    try {

      if (this.state == RunnableProcessState.RUNNING) {
        this.process.destroy();
        if (!this.doneCond.await(DESTROY_WAIT_TIME, TimeUnit.MILLISECONDS)) {
          LOG.log(Level.FINE, "{0} milliseconds elapsed", DESTROY_WAIT_TIME);
        }
      }

      if (this.state == RunnableProcessState.RUNNING) {
        LOG.log(Level.WARNING, "The child process survived Process.destroy()");
        if (OSUtils.isUnix() || OSUtils.isWindows()) {
          LOG.log(Level.WARNING, "Attempting to kill the process via the kill command line");
          try {
            final long pid = readPID();
            OSUtils.kill(pid);
          } catch (final IOException | InterruptedException | NumberFormatException e) {
            LOG.log(Level.SEVERE, "Unable to kill the process.", e);
          }
        }
      }

    } catch (final InterruptedException ex) {
      LOG.log(Level.SEVERE,
          "Interrupted while waiting for the process \"{0}\" to complete. Exception: {1}",
          new Object[] {this.id, ex});
    } finally {
      this.stateLock.unlock();
    }
  }
1209164
def stop(self, reason=None):
        """"""
        self.logger.info('stopping')
        self.loop.stop(pyev.EVBREAK_ALL)