Backout mwakeup, etc.
This commit is contained in:
parent
ea6fb35e6e
commit
cc42947242
@ -491,26 +491,6 @@ cv_signal(struct cv *cvp)
|
||||
mtx_unlock_spin(&sched_lock);
|
||||
}
|
||||
|
||||
/*
|
||||
* 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.
|
||||
@ -527,25 +507,6 @@ cv_broadcast(struct cv *cvp)
|
||||
mtx_unlock_spin(&sched_lock);
|
||||
}
|
||||
|
||||
/*
|
||||
* 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.
|
||||
|
@ -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 @@ mwakeup(ident, mtx)
|
||||
/*
|
||||
* 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) {
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user