diff options
Diffstat (limited to 'alc/backends/oss.cpp')
-rw-r--r-- | alc/backends/oss.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/alc/backends/oss.cpp b/alc/backends/oss.cpp index 1e3ad28b..5ab07dbe 100644 --- a/alc/backends/oss.cpp +++ b/alc/backends/oss.cpp @@ -279,7 +279,7 @@ int OSSPlayback::mixerProc() const ALuint frame_size{mDevice->frameSizeFromFmt()}; - lock(); + std::unique_lock<OSSPlayback> dlock{*this}; while(!mKillNow.load(std::memory_order_acquire) && mDevice->Connected.load(std::memory_order_acquire)) { @@ -287,9 +287,9 @@ int OSSPlayback::mixerProc() pollitem.fd = mFd; pollitem.events = POLLOUT; - unlock(); + dlock.unlock(); int pret{poll(&pollitem, 1, 1000)}; - lock(); + dlock.lock(); if(pret < 0) { if(errno == EINTR || errno == EAGAIN) @@ -324,7 +324,6 @@ int OSSPlayback::mixerProc() write_ptr += wrote; } } - unlock(); return 0; } |