Esempio n. 1
0
func (brk *Barak) StopProcess(label string, kill bool) error {
	brk.mtx.Lock()
	proc := brk.processes[label]
	brk.mtx.Unlock()

	if proc == nil {
		return fmt.Errorf("Process does not exist: %v", label)
	}

	err := pcm.Stop(proc, kill)
	return err
}
Esempio n. 2
0
func StopProcess(label string, kill bool) (*ResponseStopProcess, error) {
	barak.mtx.Lock()
	proc := barak.processes[label]
	barak.mtx.Unlock()

	if proc == nil {
		return nil, fmt.Errorf("Process does not exist: %v", label)
	}

	err := pcm.Stop(proc, kill)
	return &ResponseStopProcess{}, err
}