aboutsummaryrefslogtreecommitdiffstats
path: root/alc/backends
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-08-01 13:28:53 -0700
committerChris Robinson <[email protected]>2019-08-01 13:43:32 -0700
commit65f7fc610e6a6101509906c0c9bbbd794c9a3737 (patch)
tree48e03a76d121d2927623c8982c149acb0a8d616e /alc/backends
parent380f3dc11de1b3d8e6a00b2920cb809cfb953c0d (diff)
Add a common base for auto-deleting ref-counted objects
Which will also work as the basis for a future intrusive_ptr
Diffstat (limited to 'alc/backends')
-rw-r--r--alc/backends/base.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/alc/backends/base.cpp b/alc/backends/base.cpp
index 78b9196e..095990b7 100644
--- a/alc/backends/base.cpp
+++ b/alc/backends/base.cpp
@@ -43,11 +43,11 @@ ClockLatency BackendBase::getClockLatency()
ALuint refcount;
do {
- while(((refcount=mDevice->MixCount.load(std::memory_order_acquire))&1))
+ while(((refcount=ReadRef(mDevice->MixCount))&1) != 0)
std::this_thread::yield();
ret.ClockTime = GetDeviceClockTime(mDevice);
std::atomic_thread_fence(std::memory_order_acquire);
- } while(refcount != mDevice->MixCount.load(std::memory_order_relaxed));
+ } while(refcount != ReadRef(mDevice->MixCount));
/* NOTE: The device will generally have about all but one periods filled at
* any given time during playback. Without a more accurate measurement from