From 8b9b1bf90a686d7afb1ea7d00aeb1a80742d2b98 Mon Sep 17 00:00:00 2001 From: m0dB Date: Sun, 10 Nov 2024 13:12:14 +0100 Subject: [PATCH] use atomics to fix tsan detected race condition in vsyncthread PLL --- src/waveform/vsyncthread.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/waveform/vsyncthread.h b/src/waveform/vsyncthread.h index 48ded9f5f08..fb30e71ee4d 100644 --- a/src/waveform/vsyncthread.h +++ b/src/waveform/vsyncthread.h @@ -71,8 +71,8 @@ class VSyncThread : public QThread { // phase locked loop std::mutex m_pllMutex; PerformanceTimer m_pllTimer; - int m_pllInitCnt; - bool m_pllPendingUpdate; + std::atomic m_pllInitCnt; + std::atomic m_pllPendingUpdate; double m_pllInitSum; double m_pllInitAvg; double m_pllPhaseOut;