mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-10-31 22:25:25 -04:00
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>
This commit is contained in:
parent
65d02b7a83
commit
a31a736009
1 changed files with 6 additions and 1 deletions
|
|
@ -1152,8 +1152,13 @@ read_events(struct wl_display *display)
|
||||||
if (display->reader_count == 0) {
|
if (display->reader_count == 0) {
|
||||||
total = wl_connection_read(display->connection);
|
total = wl_connection_read(display->connection);
|
||||||
if (total == -1) {
|
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;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
display_fatal_error(display, errno);
|
display_fatal_error(display, errno);
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue