diff options
author | Chris Robinson <[email protected]> | 2018-11-26 18:07:52 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-11-26 18:07:52 -0800 |
commit | 461ef4196ed78a2803325fbda45a035ed5e6cf71 (patch) | |
tree | bf92d6f96cca8e296e88766d3213950a1f797635 /Alc | |
parent | 1a9edd4e35ff15bef8662313a9982f62732f5055 (diff) |
Avoid using ATOMIC_LOAD on ALCdevice::Connected
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/backends/alsa.cpp | 4 | ||||
-rw-r--r-- | Alc/backends/dsound.cpp | 4 | ||||
-rw-r--r-- | Alc/backends/jack.cpp | 2 | ||||
-rw-r--r-- | Alc/backends/null.cpp | 2 | ||||
-rw-r--r-- | Alc/backends/opensl.cpp | 5 | ||||
-rw-r--r-- | Alc/backends/oss.cpp | 2 | ||||
-rw-r--r-- | Alc/backends/pulseaudio.cpp | 4 | ||||
-rw-r--r-- | Alc/backends/sndio.cpp | 4 | ||||
-rw-r--r-- | Alc/backends/solaris.cpp | 2 | ||||
-rw-r--r-- | Alc/backends/wave.cpp | 2 | ||||
-rw-r--r-- | Alc/backends/winmm.cpp | 4 |
11 files changed, 17 insertions, 18 deletions
diff --git a/Alc/backends/alsa.cpp b/Alc/backends/alsa.cpp index 20ffc559..629038b8 100644 --- a/Alc/backends/alsa.cpp +++ b/Alc/backends/alsa.cpp @@ -1150,7 +1150,7 @@ ALCenum ALCcaptureAlsa_captureSamples(ALCcaptureAlsa *self, ALCvoid *buffer, ALC } self->mLastAvail -= samples; - while(ATOMIC_LOAD(&device->Connected, almemory_order_acquire) && samples > 0) + while(device->Connected.load(std::memory_order_acquire) && samples > 0) { snd_pcm_sframes_t amt{0}; @@ -1208,7 +1208,7 @@ ALCuint ALCcaptureAlsa_availableSamples(ALCcaptureAlsa *self) ALCdevice *device = STATIC_CAST(ALCbackend, self)->mDevice; snd_pcm_sframes_t avail{0}; - if(ATOMIC_LOAD(&device->Connected, almemory_order_acquire) && self->DoCapture) + if(device->Connected.load(std::memory_order_acquire) && self->DoCapture) avail = snd_pcm_avail_update(self->PcmHandle); if(avail < 0) { diff --git a/Alc/backends/dsound.cpp b/Alc/backends/dsound.cpp index 3bce5cad..2bb6048a 100644 --- a/Alc/backends/dsound.cpp +++ b/Alc/backends/dsound.cpp @@ -272,7 +272,7 @@ FORCE_ALIGN int ALCdsoundPlayback_mixerProc(ALCdsoundPlayback *self) DWORD LastCursor{0u}; Buffer->GetCurrentPosition(&LastCursor, nullptr); while(!self->mKillNow.load(std::memory_order_acquire) && - ATOMIC_LOAD(&device->Connected, almemory_order_acquire)) + device->Connected.load(std::memory_order_acquire)) { // Get current play cursor DWORD PlayCursor; @@ -901,7 +901,7 @@ ALCuint ALCdsoundCapture_availableSamples(ALCdsoundCapture *self) { ALCdevice *device = STATIC_CAST(ALCbackend, self)->mDevice; - if(!ATOMIC_LOAD(&device->Connected, almemory_order_acquire)) + if(!device->Connected.load(std::memory_order_acquire)) return ll_ringbuffer_read_space(self->Ring); ALsizei FrameSize{FrameSizeFromDevFmt(device->FmtChans, device->FmtType, device->mAmbiOrder)}; diff --git a/Alc/backends/jack.cpp b/Alc/backends/jack.cpp index daa15219..fc385f7b 100644 --- a/Alc/backends/jack.cpp +++ b/Alc/backends/jack.cpp @@ -301,7 +301,7 @@ static int ALCjackPlayback_mixerProc(void *arg) ALCjackPlayback_lock(self); while(!self->mKillNow.load(std::memory_order_acquire) && - ATOMIC_LOAD(&device->Connected, almemory_order_acquire)) + device->Connected.load(std::memory_order_acquire)) { ALuint todo, len1, len2; diff --git a/Alc/backends/null.cpp b/Alc/backends/null.cpp index 631c23d3..969193b8 100644 --- a/Alc/backends/null.cpp +++ b/Alc/backends/null.cpp @@ -92,7 +92,7 @@ int ALCnullBackend_mixerProc(ALCnullBackend *self) ALint64 done{0}; auto start = std::chrono::steady_clock::now(); while(!self->mKillNow.load(std::memory_order_acquire) && - ATOMIC_LOAD(&device->Connected, almemory_order_acquire)) + device->Connected.load(std::memory_order_acquire)) { auto now = std::chrono::steady_clock::now(); diff --git a/Alc/backends/opensl.cpp b/Alc/backends/opensl.cpp index 2a87e19b..d59ef5f3 100644 --- a/Alc/backends/opensl.cpp +++ b/Alc/backends/opensl.cpp @@ -248,9 +248,8 @@ static int ALCopenslPlayback_mixerProc(void *arg) if(SL_RESULT_SUCCESS != result) aluHandleDisconnect(device, "Failed to get playback buffer: 0x%08x", result); - while(SL_RESULT_SUCCESS == result && - !ATOMIC_LOAD(&self->mKillNow, almemory_order_acquire) && - ATOMIC_LOAD(&device->Connected, almemory_order_acquire)) + while(SL_RESULT_SUCCESS == result && !self->mKillNow.load(std::memory_order_acquire) && + device->Connected.load(std::memory_order_acquire)) { size_t todo; diff --git a/Alc/backends/oss.cpp b/Alc/backends/oss.cpp index 58a4dbad..5e8100fb 100644 --- a/Alc/backends/oss.cpp +++ b/Alc/backends/oss.cpp @@ -302,7 +302,7 @@ int ALCplaybackOSS_mixerProc(ALCplaybackOSS *self) ALCplaybackOSS_lock(self); while(!self->mKillNow.load(std::memory_order_acquire) && - ATOMIC_LOAD(&device->Connected, almemory_order_acquire)) + device->Connected.load(std::memory_order_acquire)) { FD_ZERO(&wfds); FD_SET(self->fd, &wfds); diff --git a/Alc/backends/pulseaudio.cpp b/Alc/backends/pulseaudio.cpp index 560656c5..51b7c0a9 100644 --- a/Alc/backends/pulseaudio.cpp +++ b/Alc/backends/pulseaudio.cpp @@ -871,7 +871,7 @@ int PulsePlayback_mixerProc(PulsePlayback *self) size_t frame_size{pa_frame_size(&self->spec)}; while(!self->mKillNow.load(std::memory_order_acquire) && - ATOMIC_LOAD(&device->Connected, almemory_order_acquire)) + device->Connected.load(std::memory_order_acquire)) { ssize_t len{static_cast<ssize_t>(pa_stream_writable_size(self->stream))}; if(UNLIKELY(len < 0)) @@ -1676,7 +1676,7 @@ ALCuint PulseCapture_availableSamples(PulseCapture *self) ALCdevice *device{STATIC_CAST(ALCbackend,self)->mDevice}; size_t readable{self->cap_remain}; - if(ATOMIC_LOAD(&device->Connected, almemory_order_acquire)) + if(device->Connected.load(std::memory_order_acquire)) { palock_guard _{self->loop}; size_t got{pa_stream_readable_size(self->stream)}; diff --git a/Alc/backends/sndio.cpp b/Alc/backends/sndio.cpp index d7340f4a..2a999bd4 100644 --- a/Alc/backends/sndio.cpp +++ b/Alc/backends/sndio.cpp @@ -99,7 +99,7 @@ static int SndioPlayback_mixerProc(void *ptr) frameSize = FrameSizeFromDevFmt(device->FmtChans, device->FmtType, device->mAmbiOrder); while(!self->mKillNow.load(std::memory_order_acquire) && - ATOMIC_LOAD(&device->Connected, almemory_order_acquire)) + device->Connected.load(std::memory_order_acquire)) { ALsizei len = self->data_size; ALubyte *WritePtr = static_cast<ALubyte*>(self->mix_data); @@ -335,7 +335,7 @@ static int SndioCapture_recordProc(void* ptr) frameSize = FrameSizeFromDevFmt(device->FmtChans, device->FmtType, device->mAmbiOrder); while(!self->mKillNow.load(std::memory_order_acquire) && - ATOMIC_LOAD(&device->Connected, almemory_order_acquire)) + device->Connected.load(std::memory_order_acquire)) { size_t total, todo; diff --git a/Alc/backends/solaris.cpp b/Alc/backends/solaris.cpp index cd3f615f..0ca7a4ec 100644 --- a/Alc/backends/solaris.cpp +++ b/Alc/backends/solaris.cpp @@ -117,7 +117,7 @@ static int ALCsolarisBackend_mixerProc(void *ptr) ALCsolarisBackend_lock(self); while(!self->mKillNow.load(std::memory_order_acquire) && - ATOMIC_LOAD(&device->Connected, almemory_order_acquire)) + device->Connected.load(std::memory_order_acquire)) { FD_ZERO(&wfds); FD_SET(self->fd, &wfds); diff --git a/Alc/backends/wave.cpp b/Alc/backends/wave.cpp index 2475aa9f..25245a1b 100644 --- a/Alc/backends/wave.cpp +++ b/Alc/backends/wave.cpp @@ -135,7 +135,7 @@ int ALCwaveBackend_mixerProc(ALCwaveBackend *self) ALint64 done{0}; auto start = std::chrono::steady_clock::now(); while(!self->mKillNow.load(std::memory_order_acquire) && - ATOMIC_LOAD(&device->Connected, almemory_order_acquire)) + device->Connected.load(std::memory_order_acquire)) { auto now = std::chrono::steady_clock::now(); diff --git a/Alc/backends/winmm.cpp b/Alc/backends/winmm.cpp index b4651b4c..2524ecc1 100644 --- a/Alc/backends/winmm.cpp +++ b/Alc/backends/winmm.cpp @@ -206,7 +206,7 @@ FORCE_ALIGN int ALCwinmmPlayback_mixerProc(ALCwinmmPlayback *self) ALCwinmmPlayback_lock(self); while(!self->mKillNow.load(std::memory_order_acquire) && - ATOMIC_LOAD(&device->Connected, almemory_order_acquire)) + device->Connected.load(std::memory_order_acquire)) { ALsizei todo = self->Writable.load(std::memory_order_acquire); if(todo < 1) @@ -487,7 +487,7 @@ int ALCwinmmCapture_captureProc(ALCwinmmCapture *self) ALCwinmmCapture_lock(self); while(!self->mKillNow.load(std::memory_order_acquire) && - ATOMIC_LOAD(&device->Connected, almemory_order_acquire)) + device->Connected.load(std::memory_order_acquire)) { ALsizei todo = self->Readable.load(std::memory_order_acquire); if(todo < 1) |