aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends/jack.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Alc/backends/jack.cpp')
-rw-r--r--Alc/backends/jack.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/Alc/backends/jack.cpp b/Alc/backends/jack.cpp
index 0862f685..0679dd73 100644
--- a/Alc/backends/jack.cpp
+++ b/Alc/backends/jack.cpp
@@ -151,7 +151,7 @@ struct ALCjackPlayback final : public ALCbackend {
jack_port_t *Port[MAX_OUTPUT_CHANNELS]{};
ll_ringbuffer_t *Ring{nullptr};
- alsem_t Sem;
+ al::semaphore Sem;
std::atomic<ALenum> mKillNow{AL_TRUE};
std::thread mThread;
@@ -183,8 +183,6 @@ static void ALCjackPlayback_Construct(ALCjackPlayback *self, ALCdevice *device)
new (self) ALCjackPlayback{};
ALCbackend_Construct(STATIC_CAST(ALCbackend, self), device);
SET_VTABLE2(ALCjackPlayback, ALCbackend, self);
-
- alsem_init(&self->Sem, 0);
}
static void ALCjackPlayback_Destruct(ALCjackPlayback *self)
@@ -201,8 +199,6 @@ static void ALCjackPlayback_Destruct(ALCjackPlayback *self)
self->Client = NULL;
}
- alsem_destroy(&self->Sem);
-
ALCbackend_Destruct(STATIC_CAST(ALCbackend, self));
self->~ALCjackPlayback();
}
@@ -278,7 +274,7 @@ static int ALCjackPlayback_process(jack_nframes_t numframes, void *arg)
}
ll_ringbuffer_read_advance(self->Ring, total);
- alsem_post(&self->Sem);
+ self->Sem.post();
if(numframes > total)
{
@@ -309,7 +305,7 @@ static int ALCjackPlayback_mixerProc(ALCjackPlayback *self)
if(ll_ringbuffer_write_space(self->Ring) < device->UpdateSize)
{
ALCjackPlayback_unlock(self);
- alsem_wait(&self->Sem);
+ self->Sem.wait();
ALCjackPlayback_lock(self);
continue;
}
@@ -485,7 +481,7 @@ static void ALCjackPlayback_stop(ALCjackPlayback *self)
if(self->mKillNow.exchange(AL_TRUE, std::memory_order_acq_rel) || !self->mThread.joinable())
return;
- alsem_post(&self->Sem);
+ self->Sem.post();
self->mThread.join();
jack_deactivate(self->Client);