diff options
author | Chris Robinson <[email protected]> | 2018-11-19 05:04:17 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-11-19 05:04:17 -0800 |
commit | ac2a420351a2489fc347689968767a15f863ec77 (patch) | |
tree | 262c3a296386959fbcb43bfbbbd93acfef6cb5c5 | |
parent | ad5f9d9b22f8860f0c6ca06004c134182dda95df (diff) |
Remove the ATOMIC_THREAD_FENCE macro
-rw-r--r-- | Alc/backends/base.cpp | 6 | ||||
-rw-r--r-- | OpenAL32/alBuffer.cpp | 2 | ||||
-rw-r--r-- | OpenAL32/alSource.cpp | 6 | ||||
-rw-r--r-- | common/atomic.h | 3 |
4 files changed, 7 insertions, 10 deletions
diff --git a/Alc/backends/base.cpp b/Alc/backends/base.cpp index 61c2fe90..f3a4c60e 100644 --- a/Alc/backends/base.cpp +++ b/Alc/backends/base.cpp @@ -55,11 +55,11 @@ ClockLatency ALCbackend_getClockLatency(ALCbackend *self) ClockLatency ret; do { - while(((refcount=ATOMIC_LOAD(&device->MixCount, almemory_order_acquire))&1)) + while(((refcount=device->MixCount.load(std::memory_order_acquire))&1)) althrd_yield(); ret.ClockTime = GetDeviceClockTime(device); - ATOMIC_THREAD_FENCE(almemory_order_acquire); - } while(refcount != ATOMIC_LOAD(&device->MixCount, almemory_order_relaxed)); + std::atomic_thread_fence(std::memory_order_acquire); + } while(refcount != device->MixCount.load(std::memory_order_relaxed)); /* NOTE: The device will generally have about all but one periods filled at * any given time during playback. Without a more accurate measurement from diff --git a/OpenAL32/alBuffer.cpp b/OpenAL32/alBuffer.cpp index cd173193..b08518ba 100644 --- a/OpenAL32/alBuffer.cpp +++ b/OpenAL32/alBuffer.cpp @@ -656,7 +656,7 @@ AL_API void AL_APIENTRY alFlushMappedBufferSOFT(ALuint buffer, ALsizei offset, A * asynchronously. Currently we just say the app shouldn't write where * OpenAL's reading, and hope for the best... */ - ATOMIC_THREAD_FENCE(almemory_order_seq_cst); + std::atomic_thread_fence(std::memory_order_seq_cst); } } diff --git a/OpenAL32/alSource.cpp b/OpenAL32/alSource.cpp index 39f70ab5..2585039f 100644 --- a/OpenAL32/alSource.cpp +++ b/OpenAL32/alSource.cpp @@ -3284,7 +3284,7 @@ static ALint64 GetSourceSampleOffset(ALsource *Source, ALCcontext *context, ALui readPos |= (ALuint64)ATOMIC_LOAD(&voice->position_fraction, almemory_order_relaxed) << (32-FRACTIONBITS); } - ATOMIC_THREAD_FENCE(almemory_order_acquire); + std::atomic_thread_fence(std::memory_order_acquire); } while(refcount != ATOMIC_LOAD(&device->MixCount, almemory_order_relaxed)); if(voice) @@ -3331,7 +3331,7 @@ static ALdouble GetSourceSecOffset(ALsource *Source, ALCcontext *context, ALuint FRACTIONBITS; readPos |= ATOMIC_LOAD(&voice->position_fraction, almemory_order_relaxed); } - ATOMIC_THREAD_FENCE(almemory_order_acquire); + std::atomic_thread_fence(std::memory_order_acquire); } while(refcount != ATOMIC_LOAD(&device->MixCount, almemory_order_relaxed)); offset = 0.0; @@ -3393,7 +3393,7 @@ static ALdouble GetSourceOffset(ALsource *Source, ALenum name, ALCcontext *conte readPos = ATOMIC_LOAD(&voice->position, almemory_order_relaxed); readPosFrac = ATOMIC_LOAD(&voice->position_fraction, almemory_order_relaxed); } - ATOMIC_THREAD_FENCE(almemory_order_acquire); + std::atomic_thread_fence(std::memory_order_acquire); } while(refcount != ATOMIC_LOAD(&device->MixCount, almemory_order_relaxed)); offset = 0.0; diff --git a/common/atomic.h b/common/atomic.h index b25bd4dd..87560e3d 100644 --- a/common/atomic.h +++ b/common/atomic.h @@ -15,7 +15,6 @@ #define ATOMIC(T) std::atomic<T> #define ATOMIC_INIT std::atomic_init -#define ATOMIC_INIT_STATIC ATOMIC_VAR_INIT #define ATOMIC_LOAD std::atomic_load_explicit #define ATOMIC_STORE std::atomic_store_explicit @@ -23,8 +22,6 @@ #define ATOMIC_ADD std::atomic_fetch_add_explicit #define ATOMIC_SUB std::atomic_fetch_sub_explicit -#define ATOMIC_THREAD_FENCE std::atomic_thread_fence - #define ATOMIC_LOAD_SEQ(_val) ATOMIC_LOAD(_val, almemory_order_seq_cst) #define ATOMIC_STORE_SEQ(_val, _newval) ATOMIC_STORE(_val, _newval, almemory_order_seq_cst) |