[Bug] Data race on AudioThumbnail::numSamplesFinished

Xcode’s Thread Sanitizer alerts on a (probably benign) data race on AudioThumbnail::numSamplesFinished. It is being non-atomically read in getProportionComplete() while being written to in setLevels().

A simple fix would be to wrap numSamplesFinished with std::atomic, similar to totalSamples.


Thanks for raising this. I’ve tried to improve the thread-safety of AudioThumbnail here:

Please try updating and let us know if you encounter any further issues.