1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

AudioProcessLoadMeasurer: Fix a data race

This commit is contained in:
Tom Poole 2022-03-22 11:00:30 +00:00
parent e9417c645b
commit 27abc89396
2 changed files with 30 additions and 18 deletions

View file

@ -96,8 +96,13 @@ public:
void registerRenderTime (double millisecondsTaken, int numSamples);
private:
double cpuUsageProportion = 0, timeToCpuScale = 0, msPerSample = 0;
int xruns = 0, samplesPerBlock = 0;
void registerRenderTimeLocked (double, int);
SpinLock mutex;
int samplesPerBlock = 0;
double msPerSample = 0;
std::atomic<double> cpuUsageProportion { 0 };
std::atomic<int> xruns { 0 };
};