Fix update thread not successfully waking up with LWP

Commit 08b945568 broke empth_sleep() for LWP: it returned zero even
when woken up early.
This commit is contained in:
Ron Koenderink 2009-02-07 20:09:30 -06:00
parent c7e2442d3a
commit 4c32aac832

View file

@ -132,9 +132,9 @@ lwpWakeupFd(struct lwpProc *proc)
return;
lwpStatus(proc, "awakening; was sleeping on fd %d", proc->fd);
if (proc->runtime != (time_t)-1) {
if (proc->runtime != (time_t)-1 && proc->runtime != 0) {
/* is in LwpDelayq; leave the job to lwpWakeupSleep() */
proc->runtime = 0;
proc->runtime = (time_t)-1;
return;
}
FD_CLR(proc->fd, &LwpReadfds);
@ -161,6 +161,7 @@ lwpWakeupSleep(void)
while (NULL != (proc = lwpGetFirst(&LwpDelayq))) {
if (now >= proc->runtime) {
lwpStatus(proc, "sleep done");
if (proc->runtime != 0)
proc->runtime = (time_t)-1;
if (proc->fd >= 0)
lwpWakeupFd(proc);