Source-Changes-HG archive

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

[src/trunk]: src/sys/compat/osf1 usleep_thread: round ticks up, don't sleep f...



details:   https://anonhg.NetBSD.org/src/rev/869a9535a762
branches:  trunk
changeset: 472853:869a9535a762
user:      cgd <cgd%NetBSD.org@localhost>
date:      Mon May 10 02:55:57 1999 +0000

description:
usleep_thread: round ticks up, don't sleep forever, use better wchan

diffstat:

 sys/compat/osf1/osf1_misc.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 0129eb97c98c -r 869a9535a762 sys/compat/osf1/osf1_misc.c
--- a/sys/compat/osf1/osf1_misc.c       Mon May 10 02:54:57 1999 +0000
+++ b/sys/compat/osf1/osf1_misc.c       Mon May 10 02:55:57 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: osf1_misc.c,v 1.51 1999/05/05 01:51:33 cgd Exp $ */
+/* $NetBSD: osf1_misc.c,v 1.52 1999/05/10 02:55:57 cgd Exp $ */
 
 /*
  * Copyright (c) 1999 Christopher G. Demetriou.  All rights reserved.
@@ -279,12 +279,15 @@
        tv.tv_sec = otv.tv_sec;
        tv.tv_usec = otv.tv_usec;
 
-       ticks = ((u_long)tv.tv_sec * 1000000 + tv.tv_usec) / tick;
+       ticks = howmany((u_long)tv.tv_sec * 1000000 + tv.tv_usec, tick);
+       if (ticks == 0)
+               ticks = 1;
+
        s = splclock();
        tv = time;
        splx(s);
 
-       tsleep(p, PUSER|PCATCH, "OSF/1", ticks);        /* XXX */
+       tsleep(p, PUSER|PCATCH, "uslpthrd", ticks);     /* XXX */
 
        if (SCARG(uap, slept) != NULL) {
                s = splclock();



Home | Main Index | Thread Index | Old Index