Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/kern_exit.c
Show First 20 Lines • Show All 161 Lines • ▼ Show 20 Lines | if (p1->p_reapsubtree == p->p_reapsubtree) { | ||||
clear = false; | clear = false; | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
if (clear) | if (clear) | ||||
proc_id_clear(PROC_ID_REAP, p->p_reapsubtree); | proc_id_clear(PROC_ID_REAP, p->p_reapsubtree); | ||||
} | } | ||||
static void | void | ||||
clear_orphan(struct proc *p) | clear_orphan(struct proc *p) | ||||
markj: IMO it should be renamed to proc_clear_orphan() now. | |||||
Not Done Inline ActionsDo you disagree with my comment above? markj: Do you disagree with my comment above? | |||||
{ | { | ||||
struct proc *p1; | struct proc *p1; | ||||
sx_assert(&proctree_lock, SA_XLOCKED); | sx_assert(&proctree_lock, SA_XLOCKED); | ||||
if ((p->p_treeflag & P_TREE_ORPHANED) == 0) | if ((p->p_treeflag & P_TREE_ORPHANED) == 0) | ||||
return; | return; | ||||
if ((p->p_treeflag & P_TREE_FIRST_ORPHAN) != 0) { | if ((p->p_treeflag & P_TREE_FIRST_ORPHAN) != 0) { | ||||
p1 = LIST_NEXT(p, p_orphan); | p1 = LIST_NEXT(p, p_orphan); | ||||
▲ Show 20 Lines • Show All 1,173 Lines • ▼ Show 20 Lines | loop_locked: | ||||
goto loop; | goto loop; | ||||
} | } | ||||
/* | /* | ||||
* Make process 'parent' the new parent of process 'child'. | * Make process 'parent' the new parent of process 'child'. | ||||
* Must be called with an exclusive hold of proctree lock. | * Must be called with an exclusive hold of proctree lock. | ||||
*/ | */ | ||||
void | void | ||||
proc_reparent(struct proc *child, struct proc *parent, bool set_oppid) | proc_reparent(struct proc *child, struct proc *parent, bool set_oppid) | ||||
Not Done Inline ActionsCan you explain why do you require PROC_LOCK there ? kib: Can you explain why do you require PROC_LOCK there ? | |||||
Done Inline Actionsp_flag is protected by PROC_LOCK. oshogbo: p_flag is protected by PROC_LOCK.
But I guess the proctree_lock should be enough. | |||||
{ | { | ||||
sx_assert(&proctree_lock, SX_XLOCKED); | sx_assert(&proctree_lock, SX_XLOCKED); | ||||
PROC_LOCK_ASSERT(child, MA_OWNED); | PROC_LOCK_ASSERT(child, MA_OWNED); | ||||
if (child->p_pptr == parent) | if (child->p_pptr == parent) | ||||
return; | return; | ||||
PROC_LOCK(child->p_pptr); | PROC_LOCK(child->p_pptr); | ||||
Show All 22 Lines |
IMO it should be renamed to proc_clear_orphan() now.