// KillProcesses kills all the connection threads except the ones of whiteUsers.
966148
func KillProcesses(endpoint string, whiteUsers ...string) error {
	var inst *Instance
	var exists bool
	if inst, exists = connectionPool[endpoint]; !exists {
		return errNotRegistered
	}
	var processes []Process
	var err error
	if processes, err = GetProcessList(endpoint); err != nil {
		return err
	}
	var isWhiteUser bool
	for _, process := range processes {
		isWhiteUser = false
		for _, name := range whiteUsers {
			if process.User == name {
				isWhiteUser = true
				break
			}
		}
		if !isWhiteUser {
			inst.connection.Exec("KILL ?", process.ID)
		}
	}
	return nil
}
90338
func Kill() error {
	p, err := os.FindProcess(os.Getpid())
	if err != nil {
		return err
	}
	return p.Signal(syscall.SIGTERM)
}
835853
func KillAll(matcher Matcher, log Log) (pids []int) {
	pids, err := findPIDsWithFn(ps.Processes, matcher.Fn(), log)
	if err != nil {
		log.Errorf("Error finding process: %s", err)
		return
	}
	if len(pids) == 0 {
		return
	}
	for _, pid := range pids {
		if err := KillPID(pid, log); err != nil {
			log.Errorf("Error killing %d: %s", pid, err)
		}
	}
	return
}
443597
func (e *UniversalExecutor) shutdownProcess(_ os.Signal, proc *os.Process) error {
	if err := sendCtrlBreak(proc.Pid); err != nil {
		return fmt.Errorf("executor shutdown error: %v", err)
	}
	e.logger.Debug("sent Ctrl-Break to process", "pid", proc.Pid)

	return nil
}
343912
func (s *DescribeScalingProcessTypesOutput) SetProcesses(v []*ProcessType) *DescribeScalingProcessTypesOutput {
	s.Processes = v
	return s
}
1157760
func (lifecycle *Lifecycle) Kill() {
	lifecycle.mutex.Lock()
	lifecycle.killFlag = true
	lifecycle.mutex.Unlock()
}
244132
func (w *stringsWatcherBase) Kill() {
	w.mu.Lock()
	defer w.mu.Unlock()

	if w.closed {
		return
	}

	w.closed = true
	close(w.changes)
	w.tomb.Kill(nil)
}
326908
func KillPID(pid int, log Log) error {
	log.Debugf("Searching OS for %d", pid)
	process, err := os.FindProcess(pid)
	if err != nil {
		return fmt.Errorf("Error finding OS process: %s", err)
	}
	if process == nil {
		return fmt.Errorf("No process found with pid %d", pid)
	}
	return process.Kill()
}
560481
func (_m *Marathon) KillApplicationTasks(applicationID string, opts *marathon.KillApplicationTasksOpts) (*marathon.Tasks, error) {
	ret := _m.Called(applicationID, opts)

	var r0 *marathon.Tasks
	if rf, ok := ret.Get(0).(func(string, *marathon.KillApplicationTasksOpts) *marathon.Tasks); ok {
		r0 = rf(applicationID, opts)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*marathon.Tasks)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(string, *marathon.KillApplicationTasksOpts) error); ok {
		r1 = rf(applicationID, opts)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
1227901
func (p *pool) KillAll(reason string) {
	for id, rp := range p.plugins {
		log.WithFields(log.Fields{
			"_block": "KillAll",
			"reason": reason,
		}).Debug(fmt.Sprintf("handling 'KillAll' for pool '%v', killing plugin '%v:%v'", p.String(), rp.Name(), rp.Version()))
		if err := rp.Stop(reason); err != nil {
			log.WithFields(log.Fields{
				"_block": "KillAll",
				"reason": reason,
			}).Error(err)
		}
		p.Kill(id, reason)
	}
}
1171144
func (p *setnsProcess) terminate() error {
	if p.cmd.Process == nil {
		return nil
	}
	err := p.cmd.Process.Kill()
	if _, werr := p.wait(); err == nil {
		err = werr
	}
	return err
}
135943
func KillPID(pidFilename string) bool {
	PIDFilename(&pidFilename)
	defer os.Remove(pidFilename)

	pid, current_status := ReadPIDFile(pidFilename)
	if current_status {
		if err := syscall.Kill(pid, 15); err == nil {
			return true
		}
	}
	return false
}
470853
func (r *marathonClient) KillTasks(tasks []string, opts *KillTaskOpts) error {
	path := fmt.Sprintf("%s/delete", marathonAPITasks)
	path, err := addOptions(path, opts)
	if err != nil {
		return nil
	}

	var post struct {
		IDs []string `json:"ids"`
	}
	post.IDs = tasks

	return r.apiPost(path, &post, nil)
}
394007
func (r *Containerd) KillContainers(ids []string) error {
	return killCRIContainers(r.Runner, ids)
}
832903
func (l *Synchronizer) PostProcess(processing map[string]struct{}) {
	// Get all locally stored data
	nodes, err := l.GetAll()
	if err != nil {
		glog.Warningf("Could not access locally stored data: %s", err)
		return
	}

	// Delete any local nodes that do not exist remotely and are not in process
	for _, node := range nodes {
		if _, ok := processing[node.GetID()]; ok {
			// pass
		} else if err := l.Delete(node.GetID()); err != nil {
			glog.Warningf("Could not delete %s from locally stored data: %s", node.GetID(), err)
		}
	}
}
1288573
func (k *K8sAPIExecutor) Kill(containerIDs []string) error {
	log.Infof("Killing containers %s", containerIDs)
	for _, containerID := range containerIDs {
		err := k.client.killGracefully(containerID)
		if err != nil {
			return err
		}
	}
	return nil
}
610509
func (k *KubeletExecutor) Kill(containerIDs []string) error {
	for _, containerID := range containerIDs {
		err := k.cli.KillGracefully(containerID)
		if err != nil {
			return err
		}
	}
	return nil
}