diff options
| author | Marek Chalupa <mchqwerty@gmail.com> | 2014-09-10 12:47:13 +0200 |
|---|---|---|
| committer | Pekka Paalanen <pekka.paalanen@collabora.co.uk> | 2014-09-11 10:22:44 +0300 |
| commit | a31a7360093dd5f4ce1a34b9889560fc37dbb7a9 (patch) | |
| tree | cc9e77a4a410e4a84e7ce65d3039a46ccb8a281b | |
| parent | display-test: test if threads are woken up on EAGAIN (diff) | |
| download | wayland-a31a7360093dd5f4ce1a34b9889560fc37dbb7a9.tar wayland-a31a7360093dd5f4ce1a34b9889560fc37dbb7a9.tar.gz wayland-a31a7360093dd5f4ce1a34b9889560fc37dbb7a9.tar.bz2 wayland-a31a7360093dd5f4ce1a34b9889560fc37dbb7a9.tar.lz wayland-a31a7360093dd5f4ce1a34b9889560fc37dbb7a9.tar.xz wayland-a31a7360093dd5f4ce1a34b9889560fc37dbb7a9.tar.zst wayland-a31a7360093dd5f4ce1a34b9889560fc37dbb7a9.zip | |
client: wake-up threads on all return paths from read_events
If wl_connection_read returned EAGAIN, we must wake up sleeping
threads. If we don't do this and the thread calling
wl_connection_read won't call wl_display_read_events again,
the sleeping threads will sleep indefinitely.
Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
| -rw-r--r-- | src/wayland-client.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/wayland-client.c b/src/wayland-client.c index 9f817f6..1b7a046 100644 --- a/src/wayland-client.c +++ b/src/wayland-client.c @@ -1152,8 +1152,13 @@ read_events(struct wl_display *display) if (display->reader_count == 0) { total = wl_connection_read(display->connection); if (total == -1) { - if (errno == EAGAIN) + if (errno == EAGAIN) { + /* we must wake up threads whenever + * the reader_count dropped to 0 */ + display_wakeup_threads(display); + return 0; + } display_fatal_error(display, errno); return -1; |
