aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJake Burkholder <jake@FreeBSD.org>2001-07-06 01:16:43 +0000
committerJake Burkholder <jake@FreeBSD.org>2001-07-06 01:16:43 +0000
commitd652b3d9187ce3b367393326cbd1eaaf43575524 (patch)
tree9885d5202221baf43ef381d60b5693cbd699e1c9
parentb8c368430c39ad9f5713bbd4db4177e8225797ea (diff)
Notes
-rw-r--r--sys/kern/kern_condvar.c39
-rw-r--r--sys/kern/kern_synch.c17
-rw-r--r--sys/sys/condvar.h2
-rw-r--r--sys/sys/systm.h6
4 files changed, 6 insertions, 58 deletions
diff --git a/sys/kern/kern_condvar.c b/sys/kern/kern_condvar.c
index cf7dbff10414d..07ed3b733fcd6 100644
--- a/sys/kern/kern_condvar.c
+++ b/sys/kern/kern_condvar.c
@@ -492,26 +492,6 @@ cv_signal(struct cv *cvp)
}
/*
- * Signal a condition variable, dropping the passed in mutex before waking
- * a waiting process.
- */
-void
-cv_signal_drop(struct cv *cvp, struct mtx *mp)
-{
-
- KASSERT(cvp != NULL, ("%s: cvp NULL", __FUNCTION__));
- KASSERT(mp != NULL, ("%s: mp NULL", __FUNCTION__));
- mtx_assert(mp, MA_OWNED | MA_NOTRECURSED);
- mtx_lock_spin(&sched_lock);
- mtx_unlock_flags(mp, MTX_NOSWITCH);
- if (!TAILQ_EMPTY(&cvp->cv_waitq)) {
- CV_SIGNAL_VALIDATE(cvp);
- cv_wakeup(cvp);
- }
- mtx_unlock_spin(&sched_lock);
-}
-
-/*
* Broadcast a signal to a condition variable. Wakes up all waiting processes.
* Should be called with the same mutex as was passed to cv_wait held.
*/
@@ -528,25 +508,6 @@ cv_broadcast(struct cv *cvp)
}
/*
- * Broadcast a signal to a condition variable, dropping the passed in mutex
- * before waking any waiting processes.
- */
-void
-cv_broadcast_drop(struct cv *cvp, struct mtx *mp)
-{
-
- KASSERT(cvp != NULL, ("%s: cvp NULL", __FUNCTION__));
- KASSERT(mp != NULL, ("%s: mp NULL", __FUNCTION__));
- mtx_assert(mp, MA_OWNED | MA_NOTRECURSED);
- mtx_lock_spin(&sched_lock);
- mtx_unlock_flags(mp, MTX_NOSWITCH);
- CV_SIGNAL_VALIDATE(cvp);
- while (!TAILQ_EMPTY(&cvp->cv_waitq))
- cv_wakeup(cvp);
- mtx_unlock_spin(&sched_lock);
-}
-
-/*
* Remove a process from the wait queue of its condition variable. This may be
* called externally.
*/
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c
index 7d55f6756ab4b..530b67ed1d5d9 100644
--- a/sys/kern/kern_synch.c
+++ b/sys/kern/kern_synch.c
@@ -709,21 +709,16 @@ unsleep(p)
}
/*
- * Make all processes sleeping on the specified identifier runnable. If
- * non-NULL, the specified mutex is dropped before any processes are made
- * runnable.
+ * Make all processes sleeping on the specified identifier runnable.
*/
void
-mwakeup(ident, mtx)
+wakeup(ident)
register void *ident;
- register struct mtx *mtx;
{
register struct slpquehead *qp;
register struct proc *p;
mtx_lock_spin(&sched_lock);
- if (mtx != NULL)
- mtx_unlock_flags(mtx, MTX_NOSWITCH);
qp = &slpque[LOOKUP(ident)];
restart:
TAILQ_FOREACH(p, qp, p_slpq) {
@@ -756,20 +751,16 @@ restart:
/*
* Make a process sleeping on the specified identifier runnable.
* May wake more than one process if a target process is currently
- * swapped out. If non-NULL, the specified mutex is dropped before
- * a process is made runnable.
+ * swapped out.
*/
void
-mwakeup_one(ident, mtx)
+wakeup_one(ident)
register void *ident;
- register struct mtx *mtx;
{
register struct slpquehead *qp;
register struct proc *p;
mtx_lock_spin(&sched_lock);
- if (mtx != NULL)
- mtx_unlock_flags(mtx, MTX_NOSWITCH);
qp = &slpque[LOOKUP(ident)];
TAILQ_FOREACH(p, qp, p_slpq) {
diff --git a/sys/sys/condvar.h b/sys/sys/condvar.h
index 903d6353a008b..5460024a748f6 100644
--- a/sys/sys/condvar.h
+++ b/sys/sys/condvar.h
@@ -59,9 +59,7 @@ int cv_timedwait(struct cv *cvp, struct mtx *mp, int timo);
int cv_timedwait_sig(struct cv *cvp, struct mtx *mp, int timo);
void cv_signal(struct cv *cvp);
-void cv_signal_drop(struct cv *cvp, struct mtx *mp);
void cv_broadcast(struct cv *cvp);
-void cv_broadcast_drop(struct cv *cvp, struct mtx *mp);
void cv_waitq_remove(struct proc *p);
diff --git a/sys/sys/systm.h b/sys/sys/systm.h
index c238f3f2acf00..aa95807856fc6 100644
--- a/sys/sys/systm.h
+++ b/sys/sys/systm.h
@@ -259,10 +259,8 @@ int msleep __P((void *chan, struct mtx *mtx, int pri, const char *wmesg,
int asleep __P((void *chan, int pri, const char *wmesg, int timo));
#define await(pri, timo) mawait(NULL, pri, timo)
int mawait __P((struct mtx *mtx, int pri, int timo));
-void mwakeup __P((void *chan, struct mtx *mtx));
-#define wakeup(chan) mwakeup(chan, NULL)
-void mwakeup_one __P((void *chan, struct mtx *mtx));
-#define wakeup_one(chan) mwakeup_one(chan, NULL)
+void wakeup __P((void *chan));
+void wakeup_one __P((void *chan));
/*
* Common `dev_t' stuff are declared here to avoid #include poisoning