From 4472d1cd10e4775ef3ad95a523b7d183b34bb18a Mon Sep 17 00:00:00 2001 From: David Faure Date: Sat, 8 Mar 2025 20:59:38 +0100 Subject: [PATCH] QWaylandWindow: fix data race on mWaitingForUpdate Caught by TSAN when running examples/quick/particles/system/. deliverUpdateRequest() is called from the main thread (and doesn't lock) and handleUpdate() is called from the render thread (and locks mFrameSyncMutex). I made the bool atomic (like others in this file), rather than locking mFrameSyncMutex. Pick-to: 6.9 6.8 Change-Id: Ic2f2eafc2d91cc9676dee5a7cd1872f91dff09e2 Reviewed-by: David Edmundson --- src/plugins/platforms/wayland/qwaylandwindow_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/wayland/qwaylandwindow_p.h b/src/plugins/platforms/wayland/qwaylandwindow_p.h index 8e0843d89eb..218dff15647 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow_p.h +++ b/src/plugins/platforms/wayland/qwaylandwindow_p.h @@ -312,7 +312,7 @@ protected: QWaitCondition mFrameSyncWait; // True when we have called deliverRequestUpdate, but the client has not yet attached a new buffer - bool mWaitingForUpdate = false; + std::atomic_bool mWaitingForUpdate = false; bool mExposed = false; // written from the main thread, read by the render thread