Use msleep_spin() instead of unlock/tsleep/lock. This was

already commited but with a wrong msleep variant and then
backed out. Note that this changes the semantic a little
as msleep_spin does not let us to specify priority after
wakeup.

Approved by:	wkoszek, cognet
Approved by:	kib (mentor)
This commit is contained in:
rdivacky 2008-07-02 20:44:33 +00:00
parent fb18bf68b2
commit d3e39bd522

View File

@ -224,9 +224,7 @@ alq_shutdown(struct alq *alq)
/* Drain IO */
while (alq->aq_flags & (AQ_FLUSHING|AQ_ACTIVE)) {
alq->aq_flags |= AQ_WANTED;
ALQ_UNLOCK(alq);
tsleep(alq, PWAIT, "aldclose", 0);
ALQ_LOCK(alq);
msleep_spin(alq, &alq->aq_mtx, "aldclose", 0);
}
ALQ_UNLOCK(alq);
@ -433,9 +431,7 @@ alq_get(struct alq *alq, int waitok)
(ale = alq->aq_entfree) == NULL &&
(waitok & ALQ_WAITOK)) {
alq->aq_flags |= AQ_WANTED;
ALQ_UNLOCK(alq);
tsleep(alq, PWAIT, "alqget", 0);
ALQ_LOCK(alq);
msleep_spin(alq, &alq->aq_mtx, "alqget", 0);
}
if (ale != NULL) {