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:
+2
-2
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user