[Wayland-bugs] [Bug 763852] gdk/wayland: event source is not multi-thread aware

gtk+ (GNOME Bugzilla) bugzilla at gnome.org
Sat Mar 19 12:18:43 UTC 2016


https://bugzilla.gnome.org/show_bug.cgi?id=763852

Matthew Waters (ystreet00) <ystreet00 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #324239|0                           |1
        is obsolete|                            |

--- Comment #8 from Matthew Waters (ystreet00) <ystreet00 at gmail.com> ---
Created attachment 324334
  --> https://bugzilla.gnome.org/attachment.cgi?id=324334&action=edit
gdk/wayland: use the multi-thread safe wayland dispatching API

This contains a small change to fix a deadlock explained below.

The scenario is two GMainLoops with separate GSource's polling the same wayland
fd.

Source 1 in Thread 1 can be woken up from another GSource (timeout, idle, frame
clock, ...) becoming ready calling _check(). There has been no write/activity
on the wayland fd so revents is 0.  Thread 2, Source 2 is still in poll() as it
has not been woken up.  Source 1 calling wl_display_read_events() in _check()
in this case will block on a condition waiting for Source 2 to exit poll() and
call wl_display_read_events() or wl_display_cancel_read() which will not occur
until e.g. the user provides some input and causes Thread 2's poll() to wake
up.

Fix is to only wl_display_read_events() on actual fd activity (signalled
through (revents & G_IO_IN)) and _cancel_read() in all other cases.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/wayland-bugs/attachments/20160319/b3a7dec3/attachment.html>


More information about the wayland-bugs mailing list