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:
parent
aa93239120
commit
bff2d4d5ff
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=180196
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user