Module Name: src
Committed By: mlelstv
Date: Sun Aug 16 14:07:19 UTC 2015
Modified Files:
src/sys/dev: ld.c
Log Message:
replace tsleep with condvar
To generate a diff of this commit:
cvs rdiff -u -r1.85 -r1.86 src/sys/dev/ld.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/ld.c
diff -u src/sys/dev/ld.c:1.85 src/sys/dev/ld.c:1.86
--- src/sys/dev/ld.c:1.85 Sun Aug 16 14:02:52 2015
+++ src/sys/dev/ld.c Sun Aug 16 14:07:19 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: ld.c,v 1.85 2015/08/16 14:02:52 mlelstv Exp $ */
+/* $NetBSD: ld.c,v 1.86 2015/08/16 14:07:19 mlelstv Exp $ */
/*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ld.c,v 1.85 2015/08/16 14:02:52 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ld.c,v 1.86 2015/08/16 14:07:19 mlelstv Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -217,9 +217,10 @@ ldenddetach(struct ld_softc *sc)
mutex_enter(&sc->sc_mutex);
/* Wait for commands queued with the hardware to complete. */
- if (sc->sc_queuecnt != 0)
- if (tsleep(&sc->sc_queuecnt, PRIBIO, "lddtch", 30 * hz))
+ if (sc->sc_queuecnt != 0) {
+ if (cv_timedwait(&sc->sc_drain, &sc->sc_mutex, 30 * hz))
printf("%s: not drained\n", dksc->sc_xname);
+ }
/* Kill off any queued buffers. */
bufq_drain(dksc->sc_bufq);