Visualization: Even better race condition handling

Yes, this will do, much better. And I hope that unlikely attribute just
works like it should.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This commit is contained in:
Christopher Snowhill 2025-07-01 05:03:42 -07:00
parent d32f77d02f
commit 542158415f

View file

@ -101,8 +101,13 @@ static VisualizationController *_sharedController = nil;
}
- (void)postLatency:(double)latency {
ignoreLatency = (latency >= 45.0) || (latency < 0.0);
self->latency = latency;
if((latency >= 45.0) || (latency < 0.0)) [[clang::unlikely]] {
ignoreLatency = YES;
self->latency = latency;
} else {
self->latency = latency;
ignoreLatency = NO;
}
}
- (double)readSampleRate {