From bf50f227b9b74b7f9a6943b3ed79c7aa6cbe2ad1 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 16 Mar 2020 01:05:14 -0700 Subject: 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. --- alc/alcmain.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/alc/alcmain.h b/alc/alcmain.h index 1560b831..9293596d 100644 --- a/alc/alcmain.h +++ b/alc/alcmain.h @@ -360,8 +360,8 @@ struct ALCdevice : public al::intrusive_ref { 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; } -- cgit v1.2.3