<html>
<head>
<base href="https://bugzilla.gnome.org/" />
</head>
<body><span class="vcard"><a href="page.cgi?id=describeuser.html&login=ystreet00%40gmail.com" title="Matthew Waters (ystreet00) <ystreet00@gmail.com>"> <span class="fn">Matthew Waters (ystreet00)</span></a>
</span> changed
<a class="bz_bug_link
bz_status_NEW "
title="NEW - gdk/wayland: event source is not multi-thread aware"
href="https://bugzilla.gnome.org/show_bug.cgi?id=763852">bug 763852</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Attachment #324239 is obsolete</td>
<td>
</td>
<td>1
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - gdk/wayland: event source is not multi-thread aware"
href="https://bugzilla.gnome.org/show_bug.cgi?id=763852#c8">Comment # 8</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - gdk/wayland: event source is not multi-thread aware"
href="https://bugzilla.gnome.org/show_bug.cgi?id=763852">bug 763852</a>
from <span class="vcard"><a href="page.cgi?id=describeuser.html&login=ystreet00%40gmail.com" title="Matthew Waters (ystreet00) <ystreet00@gmail.com>"> <span class="fn">Matthew Waters (ystreet00)</span></a>
</span></b>
<pre>Created <span class=""><a href="attachment.cgi?id=324334&action=diff" name="attach_324334" title="gdk/wayland: use the multi-thread safe wayland dispatching API">attachment 324334</a> <a href="attachment.cgi?id=324334&action=edit" title="gdk/wayland: use the multi-thread safe wayland dispatching API">[details]</a></span> <a href='review?bug=763852&attachment=324334'>[review]</a>
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.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>