Use a busy-wait when synchronizing against the mixer

The mixer should have higher priority than any thread that can make AL calls,
so even on single-core systems, it shouldn't stall the mix. It will, however,
return back to the caller as soon as it can, while yielding will give up the
timeslice if there's any other thread waiting to process even if the mix is
almost done.
This commit is contained in:
Chris Robinson
2020-03-16 01:05:14 -07:00
parent 78251fd7e6
commit bf50f227b9
+2 -2
View File
@@ -360,8 +360,8 @@ struct ALCdevice : public al::intrusive_ref<ALCdevice> {
ALuint waitForMix() const noexcept
{
ALuint refcount;
while((refcount=MixCount.load(std::memory_order_acquire))&1)
std::this_thread::yield();
while((refcount=MixCount.load(std::memory_order_acquire))&1) {
}
return refcount;
}