From 2ebbf84d61aded530c93b5bb90300c169cea0fe9 Mon Sep 17 00:00:00 2001 From: jhb Date: Tue, 16 Apr 2002 17:04:21 +0000 Subject: - Lock proctree_lock instead of pgrpsess_lock. - Exclusively lock proctree_lock while calling leavepgrp(). --- sys/kern/kern_exit.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'sys/kern/kern_exit.c') diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index db899b2..0d06804 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -231,7 +231,7 @@ exit1(td, rv) vm->vm_freer = p; } - PGRPSESS_XLOCK(); + sx_xlock(&proctree_lock); if (SESS_LEADER(p)) { register struct session *sp; @@ -251,9 +251,9 @@ exit1(td, rv) PGRP_UNLOCK(sp->s_ttyp->t_pgrp); } /* XXX tp should be locked. */ - PGRPSESS_XUNLOCK(); + sx_xunlock(&proctree_lock); (void) ttywait(tp); - PGRPSESS_XLOCK(); + sx_xlock(&proctree_lock); /* * The tty could have been revoked * if we blocked. @@ -263,10 +263,10 @@ exit1(td, rv) SESS_LOCK(p->p_session); sp->s_ttyvp = NULL; SESS_UNLOCK(p->p_session); - PGRPSESS_XUNLOCK(); + sx_xunlock(&proctree_lock); VOP_REVOKE(ttyvp, REVOKEALL); - PGRPSESS_XLOCK(); vrele(ttyvp); + sx_xlock(&proctree_lock); } } if (sp->s_ttyvp) { @@ -287,7 +287,7 @@ exit1(td, rv) SESS_UNLOCK(p->p_session); } fixjobc(p, p->p_pgrp, 0); - PGRPSESS_XUNLOCK(); + sx_xunlock(&proctree_lock); (void)acct_process(td); #ifdef KTRACE /* @@ -619,13 +619,13 @@ loop: * Finally finished with old proc entry. * Unlink it from its process group and free it. */ + sx_xlock(&proctree_lock); leavepgrp(p); sx_xlock(&allproc_lock); LIST_REMOVE(p, p_list); /* off zombproc */ sx_xunlock(&allproc_lock); - sx_xlock(&proctree_lock); LIST_REMOVE(p, p_sibling); sx_xunlock(&proctree_lock); -- cgit v1.1