diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2008-07-02 20:44:33 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2008-07-02 20:44:33 +0000 |
commit | d3e39bd522f74f1b96e7a7ee05e8c09554918ea8 (patch) | |
tree | 2fea2124c4ddc8d6c74933f33d49c9594d9b48ce /sys/kern/kern_alq.c | |
parent | fb18bf68b2514ff11c78c347e6ae76dff40c00ee (diff) | |
download | FreeBSD-src-d3e39bd522f74f1b96e7a7ee05e8c09554918ea8.zip FreeBSD-src-d3e39bd522f74f1b96e7a7ee05e8c09554918ea8.tar.gz |
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)
Diffstat (limited to 'sys/kern/kern_alq.c')
-rw-r--r-- | sys/kern/kern_alq.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/sys/kern/kern_alq.c b/sys/kern/kern_alq.c index 7a57fb4..512f358 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_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) { |