From 6126f2f62673b8823999a906b24e7d6e75da3279 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Fri, 10 Aug 2018 20:19:11 -0400 Subject: [PATCH] Make a one-time dynamic check that atomic doesn't use mutexes --- src/AudioIO.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/AudioIO.cpp b/src/AudioIO.cpp index f7ccdae5c..85eec3c0e 100644 --- a/src/AudioIO.cpp +++ b/src/AudioIO.cpp @@ -1179,6 +1179,14 @@ bool AudioIO::ValidateDeviceNames(const wxString &play, const wxString &rec) AudioIO::AudioIO() { + if (!std::atomic{}.is_lock_free()) { + // If this check fails, then the atomic members in AudioIO.h + // might be changed to atomic to be more efficient with some + // loss of precision. That could be conditionally compiled depending + // on the platform. + wxASSERT(false); + } + mAudioThreadShouldCallFillBuffersOnce = false; mAudioThreadFillBuffersLoopRunning = false; mAudioThreadFillBuffersLoopActive = false;