}
if (afterpoll_check_fd(poller,fds,nfds, poller->wakeup_pipe[0],POLLIN)) {
+ poller->pipe_nonempty = 0;
int e = libxl__self_pipe_eatall(poller->wakeup_pipe[0]);
if (e) LIBXL__EVENT_DISASTER(gc, "read wakeup", e, 0);
}
void libxl__poller_wakeup(libxl__gc *gc, libxl__poller *p)
{
+ if (p->pipe_nonempty) return;
+ p->pipe_nonempty = 1;
int e = libxl__self_pipe_wakeup(p->wakeup_pipe[1]);
if (e) LIBXL__EVENT_DISASTER(gc, "cannot poke watch pipe", e, 0);
}
int (*fd_rindices)[3]; /* see libxl_event.c:beforepoll_internal */
int wakeup_pipe[2]; /* 0 means no fd allocated */
+ bool pipe_nonempty;
/*
* We also use the poller to record whether any fds have been