From ee46f55e6e4f5aed593cbdabc83d105ef5f691bc Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 28 Jan 2007 14:34:34 +0000 Subject: [PATCH] (lwpCreate): Initialize members runtime and fd. Initializing fd is necessary to make lwpWakeupFd() work reliably. Initializing runtime isn't strictly necessary, as it is used only while the thread is on LwpDelayq, and putting it there sets runtime. --- src/lib/lwp/lwp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/lwp/lwp.c b/src/lib/lwp/lwp.c index a67ab678..3dcae1e7 100644 --- a/src/lib/lwp/lwp.c +++ b/src/lib/lwp/lwp.c @@ -145,6 +145,8 @@ lwpCreate(int priority, void (*entry)(void *), int stacksz, int flags, char *nam newp->argv = argv; newp->ud = ud; newp->dead = 0; + newp->runtime = -1; + newp->fd = -1; if (LWP_MAX_PRIO <= priority) priority = LWP_MAX_PRIO - 1; if (LwpMaxpri < (newp->pri = priority))