summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_alq.c
diff options
context:
space:
mode:
authorwkoszek <wkoszek@FreeBSD.org>2007-03-04 23:40:35 +0000
committerwkoszek <wkoszek@FreeBSD.org>2007-03-04 23:40:35 +0000
commit65aac5f5dd0252d73f5d27696b6015c355c65659 (patch)
treecfa66c27eec5ed00aa73d73df40f935f20e89ae6 /sys/kern/kern_alq.c
parent300d4098cfd89ed7f8fca1a3333256308124f41b (diff)
downloadFreeBSD-src-65aac5f5dd0252d73f5d27696b6015c355c65659.zip
FreeBSD-src-65aac5f5dd0252d73f5d27696b6015c355c65659.tar.gz
Use msleep(9) instead of tsleep(9) surrounded by lock acquisition and
release. Approved by: cognet (mentor)
Diffstat (limited to 'sys/kern/kern_alq.c')
-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