eloop: correctly set ->exit

When exiting a child eloop we should forward the exit to the parent. Also,
we should reset ->exit on ev_eloop_run() otherwise we cannot run multiple
times.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
David Herrmann 2012-03-23 17:58:19 +01:00
parent 42631efa2c
commit 5f1f1710f9

View File

@ -820,6 +820,7 @@ int ev_eloop_run(struct ev_eloop *loop, int timeout)
if (!loop)
return -EINVAL;
loop->exit = false;
log_debug("run for %d msecs", timeout);
gettimeofday(&start, NULL);
@ -857,4 +858,6 @@ void ev_eloop_exit(struct ev_eloop *loop)
log_debug("exiting %p", loop);
loop->exit = true;
if (loop->fd->loop)
ev_eloop_exit(loop->fd->loop);
}