event-loop: always do the post-dispatch check
authorAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Tue, 13 Mar 2012 11:16:13 +0000 (13:16 +0200)
committerKristian Høgsberg <krh@bitplanet.net>
Tue, 20 Mar 2012 19:15:19 +0000 (15:15 -0400)
The post-dispatch check on wl_event_loop_dispatch() was not being run
if epoll_wait returned 0 events, making the check unreliable.

src/event-loop.c

index 2dfe0ae..da7b02b 100644 (file)
@@ -462,8 +462,9 @@ wl_event_loop_dispatch(struct wl_event_loop *loop, int timeout)
                n += source->interface->dispatch(source, &ep[i]);
        }
 
-       while (n > 0)
+       do {
                n = post_dispatch_check(loop);
+       } while (n > 0);
                
        return 0;
 }