mesa/src/egl
Jonas Ådahl 36b9976e1f egl/wayland: Avoid race conditions when on non-main thread
When EGL is used on some other thread than the thread that drives the
main wl_display queue, the Wayland EGL dri2 implementation is
vulnerable to a race condition related to display round trips and global
object advertisements.

The race that may happen is that after after a proxy is created, but
before the queue is set, events meant to be emitted via the yet to be
set queue may already have been queued on the wrong queue.

In order to make it possible to avoid this race, wayland 1.11
introduced new API that allows creating a proxy wrapper that may be used
as the factory proxy when creating new proxies via Wayland requests. The
queue of a proxy wrapper can be changed without effecting what queue
events emitted by the actual proxy will be queued on, while still
effecting what default queue proxies created from it will have.

By introducing a wl_display proxy wrapper and using this when performing
round trips (via wl_display_sync()) and retrieving the global objects (via
wl_display_get_registry()), the mentioned race condition is avoided.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-01-13 15:50:37 +00:00
..
drivers egl/wayland: Avoid race conditions when on non-main thread 2017-01-13 15:50:37 +00:00
main egl: Emit correct error when robust context creation fails 2016-12-27 10:21:29 -08:00
wayland wayland-drm: add missing NULL check 2016-09-01 15:48:52 +01:00
Android.mk Android: move libdrm settings to top-level Android.common.mk 2016-06-13 15:31:29 +01:00
egl-symbols-check egl: fix make check broken by interop support 2016-04-26 21:37:07 +02:00
Makefile.am egl: Use pkg-config for Android NDK build 2016-11-15 15:49:20 +00:00
Makefile.sources automake: rework the EGL build 2015-07-22 16:35:27 +01:00
SConscript egl: Fix missing Haiku include path 2015-09-28 13:58:25 -04:00