I have a plugin where there are some calculations which occur on the Message thread as a result of parameter changes. Their results are used in the audio thread (all safely through atomics).
prepareToPlay(), I check whether
isNonRealtime() and set the result to an atomic bool. In my
parameterChanged() methods I check the value of this flag and if it is true I acquire a lock.
Is this best practice? If not, what should I look to do?