Skip to content
Commit 6fe12f02 authored by Jonas Ådahl's avatar Jonas Ådahl Committed by Pekka Paalanen
Browse files

client: Fix wl_display_roundtrip_queue() race condition



Without this commit, wl_display_roundtrip_queue() is vulnerable to a
race condition, causing the callback to be dispatched on the wrong
queue.

The race condition happens if some non-main thread calls
wl_display_roundtrip_queue() with its thread local queue, and the main
thread reads and dispatches the callback event from the
wl_display_sync() call before the thread local queue is set.

The issue is fixed by using a proxy wrapper, making the initialization
of the callback proxy atomic, effectively making it no longer possible
for some other thread to dispatch the proxy before the correct thread
local queue is set.

Signed-off-by: default avatarJonas Ådahl <jadahl@gmail.com>
[Pekka: check display_wrapper]
Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
parent 69ec70fb
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment