mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2026-06-09 09:24:57 -04:00
Try not to use atomics in performance code
This commit is contained in:
@@ -21,8 +21,8 @@ std::map<int, std::thread *> AudioThread::deviceThread;
|
||||
AudioThread::AudioThread() : IOThread(),
|
||||
currentInput(nullptr), inputQueue(nullptr), nBufferFrames(1024), sampleRate(0) {
|
||||
|
||||
audioQueuePtr.store(0);
|
||||
underflowCount.store(0);
|
||||
audioQueuePtr = 0;
|
||||
underflowCount = 0;
|
||||
active.store(false);
|
||||
outputDevice.store(-1);
|
||||
gain = 1.0;
|
||||
|
||||
@@ -92,13 +92,13 @@ public:
|
||||
static void setDeviceSampleRate(int deviceId, int sampleRate);
|
||||
|
||||
//fields below, only to be used by other AudioThreads !
|
||||
std::atomic_uint underflowCount;
|
||||
size_t underflowCount;
|
||||
//protected by m_mutex
|
||||
std::vector<AudioThread *> boundThreads;
|
||||
AudioThreadInputQueuePtr inputQueue;
|
||||
AudioThreadInputPtr currentInput;
|
||||
std::atomic_uint audioQueuePtr;
|
||||
std::atomic<float> gain;
|
||||
size_t audioQueuePtr;
|
||||
float gain;
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user