diff options
author | David Xu <davidxu@FreeBSD.org> | 2006-02-27 00:19:40 +0000 |
---|---|---|
committer | David Xu <davidxu@FreeBSD.org> | 2006-02-27 00:19:40 +0000 |
commit | 82618c7389af4c2d31e7fd034908b5ac42f25625 (patch) | |
tree | 49ea911b9675e2fe6690225fcd17931fed0c3654 /sys/kern/kern_condvar.c | |
parent | a8eb65cf822f80f5a44870fe6e7e009f089910f5 (diff) |
Notes
Diffstat (limited to 'sys/kern/kern_condvar.c')
-rw-r--r-- | sys/kern/kern_condvar.c | 35 |
1 files changed, 2 insertions, 33 deletions
diff --git a/sys/kern/kern_condvar.c b/sys/kern/kern_condvar.c index 8ccea3aab414..dbe79263b385 100644 --- a/sys/kern/kern_condvar.c +++ b/sys/kern/kern_condvar.c @@ -147,7 +147,7 @@ cv_wait_sig(struct cv *cvp, struct mtx *mp) { struct thread *td; struct proc *p; - int rval, sig; + int rval; WITNESS_SAVE_DECL(mp); td = curthread; @@ -173,28 +173,13 @@ cv_wait_sig(struct cv *cvp, struct mtx *mp) sleepq_lock(cvp); - /* - * Don't bother sleeping if we are exiting and not the exiting - * thread or if our thread is marked as interrupted. - */ - mtx_lock_spin(&sched_lock); - rval = thread_sleep_check(td); - mtx_unlock_spin(&sched_lock); - if (rval != 0) { - sleepq_release(cvp); - return (rval); - } - cvp->cv_waiters++; DROP_GIANT(); mtx_unlock(mp); sleepq_add(cvp, mp, cvp->cv_description, SLEEPQ_CONDVAR | SLEEPQ_INTERRUPTIBLE); - sig = sleepq_catch_signals(cvp); rval = sleepq_wait_sig(cvp); - if (rval == 0) - rval = sleepq_calc_signal_retval(sig); #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) @@ -273,7 +258,6 @@ cv_timedwait_sig(struct cv *cvp, struct mtx *mp, int timo) struct thread *td; struct proc *p; int rval; - int sig; WITNESS_SAVE_DECL(mp); td = curthread; @@ -300,18 +284,6 @@ cv_timedwait_sig(struct cv *cvp, struct mtx *mp, int timo) sleepq_lock(cvp); - /* - * Don't bother sleeping if we are exiting and not the exiting - * thread or if our thread is marked as interrupted. - */ - mtx_lock_spin(&sched_lock); - rval = thread_sleep_check(td); - mtx_unlock_spin(&sched_lock); - if (rval != 0) { - sleepq_release(cvp); - return (rval); - } - cvp->cv_waiters++; DROP_GIANT(); mtx_unlock(mp); @@ -319,10 +291,7 @@ cv_timedwait_sig(struct cv *cvp, struct mtx *mp, int timo) sleepq_add(cvp, mp, cvp->cv_description, SLEEPQ_CONDVAR | SLEEPQ_INTERRUPTIBLE); sleepq_set_timeout(cvp, timo); - sig = sleepq_catch_signals(cvp); - rval = sleepq_timedwait_sig(cvp, sig != 0); - if (rval == 0) - rval = sleepq_calc_signal_retval(sig); + rval = sleepq_timedwait_sig(cvp); #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) |