summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_condvar.c
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2007-06-04 23:50:56 +0000
committerjeff <jeff@FreeBSD.org>2007-06-04 23:50:56 +0000
commitea7c909871b08e0c77c4e21ea7490715d243d562 (patch)
treea5bf0e5812452f39f88440ebc8ff94193caf026c /sys/kern/kern_condvar.c
parent186ae07cb61840670b6b7bc387b690bef2c2e262 (diff)
downloadFreeBSD-src-ea7c909871b08e0c77c4e21ea7490715d243d562.zip
FreeBSD-src-ea7c909871b08e0c77c4e21ea7490715d243d562.tar.gz
Commit 2/14 of sched_lock decomposition.
- Adapt sleepqueues to the new thread_lock() mechanism. - Delay assigning the sleep queue spinlock as the thread lock until after we've checked for signals. It is illegal for a thread to return in mi_switch() with any lock assigned to td_lock other than the scheduler locks. - Change sleepq_catch_signals() to do the switch if necessary to simplify the callers. - Simplify timeout handling now that locking a sleeping thread has the side-effect of locking the sleepqueue. Some previous races are no longer possible. Tested by: kris, current@ Tested on: i386, amd64, ULE, 4BSD, libthr, libkse, PREEMPTION, etc. Discussed with: kris, attilio, kmacy, jhb, julian, bde (small parts each)
Diffstat (limited to 'sys/kern/kern_condvar.c')
-rw-r--r--sys/kern/kern_condvar.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_condvar.c b/sys/kern/kern_condvar.c
index 80dd7ef..5d3403a 100644
--- a/sys/kern/kern_condvar.c
+++ b/sys/kern/kern_condvar.c
@@ -394,8 +394,8 @@ cv_signal(struct cv *cvp)
if (cvp->cv_waiters > 0) {
cvp->cv_waiters--;
sleepq_signal(cvp, SLEEPQ_CONDVAR, -1, 0);
- } else
- sleepq_release(cvp);
+ }
+ sleepq_release(cvp);
}
/*
OpenPOWER on IntegriCloud