Thread safety requirements for TPCircularBuffer
masterThe TPCircularBuffer is thread-safe under a Single Producer / Single Consumer (SPSC) model.
To maintain thread safety:
- Ensure only one thread is producing data.
- Ensure only one thread is consuming data.
The implementation uses OSAtomic.h primitives to atomically update the buffer fill count, which is the only shared variable between the producer and consumer.