diff options
author | Chris Robinson <[email protected]> | 2018-11-19 03:21:58 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-11-19 03:21:58 -0800 |
commit | e24435ef58b2f28555e6397f502f41f36524dac9 (patch) | |
tree | 5b828032fff7d64a2d613a40e7dac09cc5c05840 /Alc/backends | |
parent | c5142530d675885415c9168869eb6c125ce10876 (diff) |
Remove the atomic exchange macros
Diffstat (limited to 'Alc/backends')
-rw-r--r-- | Alc/backends/jack.cpp | 2 | ||||
-rw-r--r-- | Alc/backends/null.cpp | 3 | ||||
-rw-r--r-- | Alc/backends/opensl.cpp | 2 | ||||
-rw-r--r-- | Alc/backends/qsa.cpp | 2 | ||||
-rw-r--r-- | Alc/backends/sndio.cpp | 4 | ||||
-rw-r--r-- | Alc/backends/solaris.cpp | 2 | ||||
-rw-r--r-- | Alc/backends/wave.cpp | 3 |
7 files changed, 8 insertions, 10 deletions
diff --git a/Alc/backends/jack.cpp b/Alc/backends/jack.cpp index c72958e7..924e1926 100644 --- a/Alc/backends/jack.cpp +++ b/Alc/backends/jack.cpp @@ -488,7 +488,7 @@ static void ALCjackPlayback_stop(ALCjackPlayback *self) { int res; - if(ATOMIC_EXCHANGE(&self->killNow, AL_TRUE, almemory_order_acq_rel)) + if(self->killNow.exchange(AL_TRUE, std::memory_order_acq_rel)) return; alsem_post(&self->Sem); diff --git a/Alc/backends/null.cpp b/Alc/backends/null.cpp index 255aa01f..47ebd0ae 100644 --- a/Alc/backends/null.cpp +++ b/Alc/backends/null.cpp @@ -168,8 +168,7 @@ ALCboolean ALCnullBackend_start(ALCnullBackend *self) void ALCnullBackend_stop(ALCnullBackend *self) { - if(ATOMIC_EXCHANGE(&self->killNow, AL_TRUE, almemory_order_acq_rel) || - !self->thread.joinable()) + if(self->killNow.exchange(AL_TRUE, std::memory_order_acq_rel) || !self->thread.joinable()) return; self->thread.join(); } diff --git a/Alc/backends/opensl.cpp b/Alc/backends/opensl.cpp index d0b1a7b1..0eb194e0 100644 --- a/Alc/backends/opensl.cpp +++ b/Alc/backends/opensl.cpp @@ -610,7 +610,7 @@ static void ALCopenslPlayback_stop(ALCopenslPlayback *self) SLresult result; int res; - if(ATOMIC_EXCHANGE_SEQ(&self->mKillNow, AL_TRUE)) + if(self->mKillNow.exchange(AL_TRUE)) return; alsem_post(&self->mSem); diff --git a/Alc/backends/qsa.cpp b/Alc/backends/qsa.cpp index 9803d77d..09082357 100644 --- a/Alc/backends/qsa.cpp +++ b/Alc/backends/qsa.cpp @@ -614,7 +614,7 @@ static void qsa_stop_playback(PlaybackWrapper *self) qsa_data *data = self->ExtraData; int res; - if(ATOMIC_EXCHANGE(&data->killNow, AL_TRUE, almemory_order_acq_rel)) + if(data->killNow.exchange(AL_TRUE, std::memory_order_acq_rel)) return; althrd_join(data->thread, &res); } diff --git a/Alc/backends/sndio.cpp b/Alc/backends/sndio.cpp index 958bc2ff..cc5eacbe 100644 --- a/Alc/backends/sndio.cpp +++ b/Alc/backends/sndio.cpp @@ -267,7 +267,7 @@ static void SndioPlayback_stop(SndioPlayback *self) { int res; - if(ATOMIC_EXCHANGE(&self->killNow, AL_TRUE, almemory_order_acq_rel)) + if(self->killNow.exchange(AL_TRUE, std::memory_order_acq_rel)) return; althrd_join(self->thread, &res); @@ -513,7 +513,7 @@ static void SndioCapture_stop(SndioCapture *self) { int res; - if(ATOMIC_EXCHANGE(&self->killNow, AL_TRUE, almemory_order_acq_rel)) + if(self->killNow.exchange(AL_TRUE, std::memory_order_acq_rel)) return; althrd_join(self->thread, &res); diff --git a/Alc/backends/solaris.cpp b/Alc/backends/solaris.cpp index 86120491..c757e5e1 100644 --- a/Alc/backends/solaris.cpp +++ b/Alc/backends/solaris.cpp @@ -282,7 +282,7 @@ static void ALCsolarisBackend_stop(ALCsolarisBackend *self) { int res; - if(ATOMIC_EXCHANGE_SEQ(&self->killNow, AL_TRUE)) + if(self->killNow.exchange(AL_TRUE)) return; althrd_join(self->thread, &res); diff --git a/Alc/backends/wave.cpp b/Alc/backends/wave.cpp index 3f8d8c97..83af40a8 100644 --- a/Alc/backends/wave.cpp +++ b/Alc/backends/wave.cpp @@ -367,8 +367,7 @@ ALCboolean ALCwaveBackend_start(ALCwaveBackend *self) void ALCwaveBackend_stop(ALCwaveBackend *self) { - if(ATOMIC_EXCHANGE(&self->killNow, AL_TRUE, almemory_order_acq_rel) || - !self->thread.joinable()) + if(self->killNow.exchange(AL_TRUE, std::memory_order_acq_rel) || !self->thread.joinable()) return; self->thread.join(); |