summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_alq.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/sys/kern/kern_alq.c b/sys/kern/kern_alq.c
index 49aa0ac..de9d25f 100644
--- a/sys/kern/kern_alq.c
+++ b/sys/kern/kern_alq.c
@@ -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(alq, &(alq)->aq_mtx, PWAIT, "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(alq, &(alq)->aq_mtx, PWAIT, "alqget", 0);
}
if (ale != NULL) {
OpenPOWER on IntegriCloud