aboutsummaryrefslogtreecommitdiffstats
path: root/alc/backends/sndio.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-10-07 23:22:06 -0700
committerChris Robinson <[email protected]>2019-10-07 23:22:06 -0700
commit52a003e9bb7c870f26436b38e62edc96385805dc (patch)
tree7625ddfd05dc06c62f8870c2f24cd22bdf5ddd68 /alc/backends/sndio.cpp
parentf0fa6c6baf673a35337d2f2cb5548dd1e33c11e7 (diff)
Avoid raw lock/unlock calls
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)};