aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-03-16 01:05:14 -0700
committerChris Robinson <[email protected]>2020-03-16 01:05:14 -0700
commitbf50f227b9b74b7f9a6943b3ed79c7aa6cbe2ad1 (patch)
tree0e2c2a594c26c7fe4aa9767c833a64cb830657ac
parent78251fd7e6dc11c63481970be9fa453540951dbd (diff)
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.
-rw-r--r--alc/alcmain.h4
1 files 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<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;
}