aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends/opensl.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-11-27 14:05:56 -0800
committerChris Robinson <[email protected]>2018-11-27 14:05:56 -0800
commit89abbe8d94436376c1dc00f5af226a79fe3bc811 (patch)
tree97cab8cc06e92dc06329a50881965a34d528bf2c /Alc/backends/opensl.cpp
parentf26083e9edc6491f553aae951886d89b70288528 (diff)
Replace last uses of alsem_t with al::semaphore
Diffstat (limited to 'Alc/backends/opensl.cpp')
-rw-r--r--Alc/backends/opensl.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/Alc/backends/opensl.cpp b/Alc/backends/opensl.cpp
index e8d4a862..c2acda3a 100644
--- a/Alc/backends/opensl.cpp
+++ b/Alc/backends/opensl.cpp
@@ -146,7 +146,7 @@ struct ALCopenslPlayback final : public ALCbackend {
SLObjectItf mBufferQueueObj{nullptr};
ll_ringbuffer_t *mRing{nullptr};
- alsem_t mSem;
+ al::semaphore mSem;
ALsizei mFrameSize{0};
@@ -178,8 +178,6 @@ static void ALCopenslPlayback_Construct(ALCopenslPlayback *self, ALCdevice *devi
new (self) ALCopenslPlayback{};
ALCbackend_Construct(STATIC_CAST(ALCbackend, self), device);
SET_VTABLE2(ALCopenslPlayback, ALCbackend, self);
-
- alsem_init(&self->mSem, 0);
}
static void ALCopenslPlayback_Destruct(ALCopenslPlayback* self)
@@ -200,8 +198,6 @@ static void ALCopenslPlayback_Destruct(ALCopenslPlayback* self)
ll_ringbuffer_free(self->mRing);
self->mRing = NULL;
- alsem_destroy(&self->mSem);
-
ALCbackend_Destruct(STATIC_CAST(ALCbackend, self));
self->~ALCopenslPlayback();
}
@@ -222,7 +218,7 @@ static void ALCopenslPlayback_process(SLAndroidSimpleBufferQueueItf UNUSED(bq),
*/
ll_ringbuffer_read_advance(self->mRing, 1);
- alsem_post(&self->mSem);
+ self->mSem.post();
}
@@ -274,7 +270,7 @@ static int ALCopenslPlayback_mixerProc(ALCopenslPlayback *self)
if(ll_ringbuffer_write_space(self->mRing) == 0)
{
ALCopenslPlayback_unlock(self);
- alsem_wait(&self->mSem);
+ self->mSem.wait();
ALCopenslPlayback_lock(self);
continue;
}
@@ -604,7 +600,7 @@ static void ALCopenslPlayback_stop(ALCopenslPlayback *self)
if(self->mKillNow.exchange(AL_TRUE) || !self->mThread.joinable())
return;
- alsem_post(&self->mSem);
+ self->mSem.post();
self->mThread.join();
result = VCALL(self->mBufferQueueObj,GetInterface)(SL_IID_PLAY, &player);