fn kill(&self) {
        let (children, processes) = {
            let mut inner = self.inner.lock();
            if inner.killed {
                return;
            }
            inner.killed = true;
            (inner.children.clone(), inner.processes.clone())
        };
        if children.is_empty() && processes.is_empty() {
            self.terminate();
            return;
        }
        for child in children {
            if let Some(child) = child.upgrade() {
                child.kill();
            }
        }
        for proc in processes {
            proc.kill();
        }
    }
/// Kill the job. The job do not terminate immediately when killed.
/// It will terminate after all its children and processes are terminated.
Kill the job. The job do not terminate immediately when killed.
It will terminate after all its children and processes are terminated.
Kill the job . The job do not terminate immediately when killed . It will terminate after all its children and processes are terminated .
fn kill(&self) {
        let (children, processes) = {
            let mut inner = self.inner.lock();
            if inner.killed {
                return;
            }
            inner.killed = true;
            (inner.children.clone(), inner.processes.clone())
        };
        if children.is_empty() && processes.is_empty() {
            self.terminate();
            return;
        }
        for child in children {
            if let Some(child) = child.upgrade() {
                child.kill();
            }
        }
        for proc in processes {
            proc.kill();
        }
    }
fn kill ( & self ) { let ( children , processes ) = { let mut inner = self . inner . lock ( ) ; if inner . killed { return ; } inner . killed = true ; ( inner . children . clone ( ) , inner . processes . clone ( ) ) } ; if children . is_empty ( ) && processes . is_empty ( ) { self . terminate ( ) ; return ; } for child in children { if let Some ( child ) = child . upgrade ( ) { child . kill ( ) ; } } for proc in processes { proc . kill ( ) ; } }
Kill the job.
Kill the job .
&self
&self