summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVal Doroshchuk <valentyn.doroshchuk@qt.io>2020-09-02 15:23:50 +0200
committerVal Doroshchuk <valentyn.doroshchuk@qt.io>2020-09-02 16:09:12 +0200
commit8a7bb753f908c47668d927e8e7c64b1c0d73632a (patch)
tree3caab76f54aee3dd904317fb0424f22d07b2ab9b
parent237a7c5dfdf2e9d9995e89c2092b49d610edfc86 (diff)
Adapt usage of QAtomicInt::store to storeRelaxed
Change-Id: I6dd611adaf4fbabf17e925e0f23fbf977529dd2c Reviewed-by: Val Doroshchuk <valentyn.doroshchuk@qt.io>
-rw-r--r--src/plugins/avfoundation/camera/avfmediaassetwriter.mm6
-rw-r--r--src/plugins/coreaudio/coreaudioinput.mm4
-rw-r--r--src/plugins/coreaudio/coreaudiooutput.mm6
-rw-r--r--src/plugins/coreaudio/coreaudioutils.mm6
4 files changed, 11 insertions, 11 deletions
diff --git a/src/plugins/avfoundation/camera/avfmediaassetwriter.mm b/src/plugins/avfoundation/camera/avfmediaassetwriter.mm
index abe7299a8..57c5cb8c5 100644
--- a/src/plugins/avfoundation/camera/avfmediaassetwriter.mm
+++ b/src/plugins/avfoundation/camera/avfmediaassetwriter.mm
@@ -134,10 +134,10 @@ using AVFAtomicInt64 = QAtomicInteger<qint64>;
if (self = [super init]) {
m_delegate = delegate;
m_setStartTime = true;
- m_state.store(WriterStateIdle);
+ m_state.storeRelaxed(WriterStateIdle);
m_startTime = kCMTimeInvalid;
m_lastTimeStamp = kCMTimeInvalid;
- m_durationInMs.store(0);
+ m_durationInMs.storeRelaxed(0);
m_audioSettings = nil;
m_videoSettings = nil;
}
@@ -362,7 +362,7 @@ using AVFAtomicInt64 = QAtomicInteger<qint64>;
CFRetain(sampleBuffer);
if (captureOutput != m_audioOutput.data()) {
- if (m_state.load() != WriterStateActive) {
+ if (m_state.loadRelaxed() != WriterStateActive) {
CFRelease(sampleBuffer);
return;
}
diff --git a/src/plugins/coreaudio/coreaudioinput.mm b/src/plugins/coreaudio/coreaudioinput.mm
index 7f305168f..9f6a1f7bc 100644
--- a/src/plugins/coreaudio/coreaudioinput.mm
+++ b/src/plugins/coreaudio/coreaudioinput.mm
@@ -908,7 +908,7 @@ void CoreAudioInput::deviceStoppped()
void CoreAudioInput::audioThreadStart()
{
startTimers();
- m_audioThreadState.store(Running);
+ m_audioThreadState.storeRelaxed(Running);
AudioOutputUnitStart(m_audioUnit);
}
@@ -922,7 +922,7 @@ void CoreAudioInput::audioThreadStop()
void CoreAudioInput::audioDeviceStop()
{
AudioOutputUnitStop(m_audioUnit);
- m_audioThreadState.store(Stopped);
+ m_audioThreadState.storeRelaxed(Stopped);
m_threadFinished.wakeOne();
}
diff --git a/src/plugins/coreaudio/coreaudiooutput.mm b/src/plugins/coreaudio/coreaudiooutput.mm
index ecbd67972..1138de3e2 100644
--- a/src/plugins/coreaudio/coreaudiooutput.mm
+++ b/src/plugins/coreaudio/coreaudiooutput.mm
@@ -244,7 +244,7 @@ CoreAudioOutput::CoreAudioOutput(const QByteArray &device)
m_clockFrequency = CoreAudioUtils::frequency() / 1000;
m_audioDeviceInfo = new CoreAudioDeviceInfo(device, QAudio::AudioOutput);
- m_audioThreadState.store(Stopped);
+ m_audioThreadState.storeRelaxed(Stopped);
m_intervalTimer = new QTimer(this);
m_intervalTimer->setInterval(1000);
@@ -685,7 +685,7 @@ void CoreAudioOutput::close()
void CoreAudioOutput::audioThreadStart()
{
startTimers();
- m_audioThreadState.store(Running);
+ m_audioThreadState.storeRelaxed(Running);
AudioOutputUnitStart(m_audioUnit);
}
@@ -706,7 +706,7 @@ void CoreAudioOutput::audioThreadDrain()
void CoreAudioOutput::audioDeviceStop()
{
AudioOutputUnitStop(m_audioUnit);
- m_audioThreadState.store(Stopped);
+ m_audioThreadState.storeRelaxed(Stopped);
m_threadFinished.wakeOne();
}
diff --git a/src/plugins/coreaudio/coreaudioutils.mm b/src/plugins/coreaudio/coreaudioutils.mm
index 171e1f8d4..1f9b9866c 100644
--- a/src/plugins/coreaudio/coreaudioutils.mm
+++ b/src/plugins/coreaudio/coreaudioutils.mm
@@ -175,12 +175,12 @@ void CoreAudioRingBuffer::releaseWriteRegion(const CoreAudioRingBuffer::Region &
int CoreAudioRingBuffer::used() const
{
- return m_bufferUsed.load();
+ return m_bufferUsed.loadRelaxed();
}
int CoreAudioRingBuffer::free() const
{
- return m_bufferSize - m_bufferUsed.load();
+ return m_bufferSize - m_bufferUsed.loadRelaxed();
}
int CoreAudioRingBuffer::size() const
@@ -192,7 +192,7 @@ void CoreAudioRingBuffer::reset()
{
m_readPos = 0;
m_writePos = 0;
- m_bufferUsed.store(0);
+ m_bufferUsed.storeRelaxed(0);
}
QT_END_NAMESPACE