aboutsummaryrefslogtreecommitdiffstats
path: root/alc/backends/sndio.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'alc/backends/sndio.cpp')
-rw-r--r--alc/backends/sndio.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/alc/backends/sndio.cpp b/alc/backends/sndio.cpp
index e0c70762..5657a241 100644
--- a/alc/backends/sndio.cpp
+++ b/alc/backends/sndio.cpp
@@ -85,9 +85,10 @@ int SndioPlayback::mixerProc()
ALubyte *WritePtr{mBuffer.data()};
size_t len{mBuffer.size()};
- lock();
- aluMixData(mDevice, WritePtr, static_cast<ALuint>(len/frameSize));
- unlock();
+ {
+ std::lock_guard<SndioPlayback> _{*this};
+ aluMixData(mDevice, WritePtr, static_cast<ALuint>(len/frameSize));
+ }
while(len > 0 && !mKillNow.load(std::memory_order_acquire))
{
size_t wrote{sio_write(mSndHandle, WritePtr, len)};