From 0de71d8e1bf23702cde09062b14df17e713abefc Mon Sep 17 00:00:00 2001 From: Paul Ferrand Date: Fri, 27 Mar 2020 18:47:19 +0100 Subject: [PATCH] Add a check that atomic is lock free --- src/sfizz/FilePool.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sfizz/FilePool.cpp b/src/sfizz/FilePool.cpp index 59a2047a..69ed4c63 100644 --- a/src/sfizz/FilePool.cpp +++ b/src/sfizz/FilePool.cpp @@ -90,6 +90,10 @@ void streamFromFile(SndfileHandle& sndFile, uint32_t numFrames, sfz::Oversamplin sfz::FilePool::FilePool(sfz::Logger& logger) : logger(logger) { + FilePromise promise; + if (!promise.dataStatus.is_lock_free()) + DBG("atomic is not lock-free; could cause issues with locking"); + for (int i = 0; i < config::numBackgroundThreads; ++i) threadPool.emplace_back( &FilePool::loadingThread, this );