Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic Guard tsleep() with a while (!(wdc_c->flags & AT_...



details:   https://anonhg.NetBSD.org/src/rev/932ce81f85bd
branches:  trunk
changeset: 475053:932ce81f85bd
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Fri Jul 30 14:59:10 1999 +0000

description:
Guard tsleep() with a while (!(wdc_c->flags & AT_DONE)) {}, as suggested by
Constantine Sapuntzakis confirmed by Bill Sommerfeld. Although nothing is
supposed to call wakeup on this without setting AT_DONE, it's good practice to
do it this way (the process may be waken up by a setrunnable() call).

diffstat:

 sys/dev/ic/wdc.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (20 lines):

diff -r 31af9f6c2326 -r 932ce81f85bd sys/dev/ic/wdc.c
--- a/sys/dev/ic/wdc.c  Fri Jul 30 14:03:55 1999 +0000
+++ b/sys/dev/ic/wdc.c  Fri Jul 30 14:59:10 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wdc.c,v 1.68 1999/06/23 19:00:17 bouyer Exp $ */
+/*     $NetBSD: wdc.c,v 1.69 1999/07/30 14:59:10 bouyer Exp $ */
 
 
 /*
@@ -1019,7 +1019,9 @@
                ret = WDC_COMPLETE;
        } else {
                if (wdc_c->flags & AT_WAIT) {
-                       tsleep(wdc_c, PRIBIO, "wdccmd", 0);
+                       while ((wdc_c->flags & AT_DONE) == 0) {
+                               tsleep(wdc_c, PRIBIO, "wdccmd", 0);
+                       }
                        ret = WDC_COMPLETE;
                } else {
                        ret = WDC_QUEUED;



Home | Main Index | Thread Index | Old Index