From 1a8f27c35024af7b4ed857a388d20f0a4a560db0 Mon Sep 17 00:00:00 2001 From: rsc Date: Fri, 14 May 2004 15:14:21 +0000 Subject: various bug fixes --- src/libthread/fdwait.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/libthread') diff --git a/src/libthread/fdwait.c b/src/libthread/fdwait.c index e583da60..b544f16d 100644 --- a/src/libthread/fdwait.c +++ b/src/libthread/fdwait.c @@ -174,8 +174,8 @@ _threadfdwait(int fd, int rw, ulong pc) struct { Channel c; - Alt *qentry[2]; ulong x; + Alt *qentry[2]; } s; threadfdwaitsetup(); @@ -214,11 +214,15 @@ threadsleep(int ms) struct { Channel c; ulong x; + Alt *qentry[2]; } s; threadfdwaitsetup(); chaninit(&s.c, sizeof(ulong), 1); - + s.c.qentry = (volatile Alt**)s.qentry; + s.c.nentry = 2; + memset(s.qentry, 0, sizeof s.qentry); + sleepchan[nsleep] = &s.c; sleeptime[nsleep++] = p9nsec()/1000000+ms; recvul(&s.c); -- cgit v1.2.3