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:
parent
c7e2442d3a
commit
4c32aac832
1 changed files with 4 additions and 3 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue