diff options
author | jhb <jhb@FreeBSD.org> | 2003-04-17 22:21:05 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2003-04-17 22:21:05 +0000 |
commit | e517678fbb354c13b3fc298c6d2f7cd346c99f83 (patch) | |
tree | fd24dcbd55aa2784db7dc226a3d09a1389c95de8 | |
parent | 2e488b055b6aa01b11c73bc45e8380c582d31579 (diff) | |
download | FreeBSD-src-e517678fbb354c13b3fc298c6d2f7cd346c99f83.zip FreeBSD-src-e517678fbb354c13b3fc298c6d2f7cd346c99f83.tar.gz |
Test the P_WEXIT flag while already hold the proc lock instead of right
after dropping it.
-rw-r--r-- | sys/kern/kern_condvar.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/kern/kern_condvar.c b/sys/kern/kern_condvar.c index 75a60c7..160434b 100644 --- a/sys/kern/kern_condvar.c +++ b/sys/kern/kern_condvar.c @@ -291,9 +291,9 @@ cv_wait_sig(struct cv *cvp, struct mtx *mp) else rval = ERESTART; } - PROC_UNLOCK(p); if (p->p_flag & P_WEXIT) rval = EINTR; + PROC_UNLOCK(p); #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) @@ -454,10 +454,9 @@ cv_timedwait_sig(struct cv *cvp, struct mtx *mp, int timo) else rval = ERESTART; } - PROC_UNLOCK(p); - if (p->p_flag & P_WEXIT) rval = EINTR; + PROC_UNLOCK(p); #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) |