// handleOrphan checks whether the process group is an orphan and has any
// stopped jobs. If yes, then appropriate signals are delivered to each thread
// group within the process group.
//
// Precondition: callers must hold TaskSet.mu for writing.
handleOrphan checks whether the process group is an orphan and has any
stopped jobs. If yes, then appropriate signals are delivered to each thread
group within the process group.

callers must hold TaskSet.mu for writing.
// handleOrphan checks whether the process group is an orphan and has any // stopped jobs . If yes then appropriate signals are delivered to each thread // group within the process group . // // Precondition : callers must hold TaskSet . mu for writing .
func (pg *ProcessGroup) handleOrphan() {
	if pg.ancestors != 0 {
		return
	}
	hasStopped := false
	pg.originator.pidns.owner.forEachThreadGroupLocked(func(tg *ThreadGroup) {
		if tg.processGroup != pg {
			return
		}
		tg.signalHandlers.mu.Lock()
		if tg.groupStopComplete {
			hasStopped = true
		}
		tg.signalHandlers.mu.Unlock()
	})
	if !hasStopped {
		return
	}
	pg.originator.pidns.owner.forEachThreadGroupLocked(func(tg *ThreadGroup) {
		if tg.processGroup != pg {
			return
		}
		tg.signalHandlers.mu.Lock()
		tg.leader.sendSignalLocked(SignalInfoPriv(linux.SIGHUP), true )
		tg.leader.sendSignalLocked(SignalInfoPriv(linux.SIGCONT), true )
		tg.signalHandlers.mu.Unlock()
	})
	return
}
func ( pg * ProcessGroup ) handleOrphan ( ) { if pg . ancestors != 0 { return } hasStopped := false pg . originator . pidns . owner . forEachThreadGroupLocked ( func ( tg * ThreadGroup ) { if tg . processGroup != pg { return } tg . signalHandlers . mu . Lock ( ) if tg . groupStopComplete { hasStopped = true } tg . signalHandlers . mu . Unlock ( ) } ) if ! hasStopped { return } pg . originator . pidns . owner . forEachThreadGroupLocked ( func ( tg * ThreadGroup ) { if tg . processGroup != pg { return } tg . signalHandlers . mu . Lock ( ) tg . leader . sendSignalLocked ( SignalInfoPriv ( linux . SIGHUP ) , true ) tg . leader . sendSignalLocked ( SignalInfoPriv ( linux . SIGCONT ) , true ) tg . signalHandlers . mu . Unlock ( ) } ) return }
handleOrphan checks whether the process group is an orphan and has any
stopped jobs.
handleOrphan checks whether the process group is an orphan and has any stopped jobs .
// Check if this process is an orphan. // See if there are any stopped jobs. // Deliver appropriate signals to all thread groups. /* group */ /* group */