aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-11-26 23:06:49 -0800
committerChris Robinson <[email protected]>2018-11-26 23:06:49 -0800
commitd06f76957c6ea2bf5311322e103946b45bde9796 (patch)
tree81ccb8de0a66a74568821bca8f09b9705851ac08 /Alc
parent4c1fc3ae00ad4890708a8789539eea4556b0634c (diff)
Remove althrd_yield
Diffstat (limited to 'Alc')
-rw-r--r--Alc/alc.cpp4
-rw-r--r--Alc/backends/base.cpp4
-rw-r--r--Alc/backends/opensl.cpp2
3 files changed, 6 insertions, 4 deletions
diff --git a/Alc/alc.cpp b/Alc/alc.cpp
index 58b2349f..ba693616 100644
--- a/Alc/alc.cpp
+++ b/Alc/alc.cpp
@@ -1624,7 +1624,7 @@ void ALCcontext_ProcessUpdates(ALCcontext *context)
*/
context->HoldUpdates.store(AL_TRUE);
while((context->UpdateCount.load(std::memory_order_acquire)&1) != 0)
- althrd_yield();
+ std::this_thread::yield();
if(!context->PropsClean.test_and_set(std::memory_order_acq_rel))
UpdateContextProps(context);
@@ -3434,7 +3434,7 @@ ALC_API void ALC_APIENTRY alcGetInteger64vSOFT(ALCdevice *device, ALCenum pname,
ALuint refcount;
do {
while(((refcount=ReadRef(&dev->MixCount))&1) != 0)
- althrd_yield();
+ std::this_thread::yield();
basecount = dev->ClockBase;
samplecount = dev->SamplesDone;
} while(refcount != ReadRef(&dev->MixCount));
diff --git a/Alc/backends/base.cpp b/Alc/backends/base.cpp
index e4c7588c..85f4b034 100644
--- a/Alc/backends/base.cpp
+++ b/Alc/backends/base.cpp
@@ -3,6 +3,8 @@
#include <stdlib.h>
+#include <thread>
+
#include "alMain.h"
#include "alu.h"
@@ -56,7 +58,7 @@ ClockLatency ALCbackend_getClockLatency(ALCbackend *self)
do {
while(((refcount=device->MixCount.load(std::memory_order_acquire))&1))
- althrd_yield();
+ std::this_thread::yield();
ret.ClockTime = GetDeviceClockTime(device);
std::atomic_thread_fence(std::memory_order_acquire);
} while(refcount != device->MixCount.load(std::memory_order_relaxed));
diff --git a/Alc/backends/opensl.cpp b/Alc/backends/opensl.cpp
index 8cea36f3..e8d4a862 100644
--- a/Alc/backends/opensl.cpp
+++ b/Alc/backends/opensl.cpp
@@ -632,7 +632,7 @@ static void ALCopenslPlayback_stop(ALCopenslPlayback *self)
{
SLAndroidSimpleBufferQueueState state;
do {
- althrd_yield();
+ std::this_thread::yield();
result = VCALL(bufferQueue,GetState)(&state);
} while(SL_RESULT_SUCCESS == result && state.count > 0);
PRINTERR(result, "bufferQueue->GetState");