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:
parent
42631efa2c
commit
5f1f1710f9
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user