(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.
This commit is contained in:
parent
e501656b4a
commit
ee46f55e6e
1 changed files with 2 additions and 0 deletions
|
@ -145,6 +145,8 @@ lwpCreate(int priority, void (*entry)(void *), int stacksz, int flags, char *nam
|
||||||
newp->argv = argv;
|
newp->argv = argv;
|
||||||
newp->ud = ud;
|
newp->ud = ud;
|
||||||
newp->dead = 0;
|
newp->dead = 0;
|
||||||
|
newp->runtime = -1;
|
||||||
|
newp->fd = -1;
|
||||||
if (LWP_MAX_PRIO <= priority)
|
if (LWP_MAX_PRIO <= priority)
|
||||||
priority = LWP_MAX_PRIO - 1;
|
priority = LWP_MAX_PRIO - 1;
|
||||||
if (LwpMaxpri < (newp->pri = priority))
|
if (LwpMaxpri < (newp->pri = priority))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue