So I’ve used the ThreadSanitizer (https://github.com/google/sanitizers) to find threading issues in my audio plugin, and noticed that it reports a data race for variables modified in
prepareToPlay and read in
This seems to be caused by
prepareToPlay being called from a thread other than the audio thread.
So do I have to synchronize access to variables between
processBlock, or do DAWs only call
prepareToPlay has returned? I assume yes, otherwise the ThreadSanitizer wouldn’t complain, I guess.
Also, is the thread that
prepareToPlay is called on the Message Thread?