What’s the reason for using a ScopedLock in the audioDeviceIOCallback in the LatencyTester class in the AudioLatencyDemo.cpp in the JuceDemo? Because you often read in the forum that you should not use locks in the audio thread. What is special here?
void audioDeviceIOCallback (const float** inputChannelData,
int numInputChannels,
float** outputChannelData,
int numOutputChannels,
int numSamples)
{
const ScopedLock sl (lock);
if (testIsRunning)
{
float* const recordingBuffer = recordedSound.getWritePointer (0);
const float* const playBuffer = testSound.getReadPointer (0);
....
....