Skip to content
  • Matthew Waters's avatar
    gdk/wayland: use the multi-thread safe wayland API · 2893526a
    Matthew Waters authored and Matthias Clasen's avatar Matthias Clasen committed
    This is required for proper integration with any other library/application that
    may perform wayland API calls and poll() the wayland fd from multiple threads.
    Using wl_display_dispatch{_queue}() is thread-safe if not mixed with custom
    poll() usage, which GSource/GMainContext does.
    
    Essentially, the problem is that multiple threads polling and reading
    the same fd is extremely racy.  Use the wayland provided API for allowing
    concurrent access to the wayland display fd.
    
    See the wayland man pages for wl_display_prepare_read(),
    wl_display_cancel_read() and wl_display_read_events() for more details.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=763852
    2893526a