diff options
author | Chris Robinson <[email protected]> | 2019-10-07 23:22:06 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-10-07 23:22:06 -0700 |
commit | 52a003e9bb7c870f26436b38e62edc96385805dc (patch) | |
tree | 7625ddfd05dc06c62f8870c2f24cd22bdf5ddd68 /alc/backends/solaris.cpp | |
parent | f0fa6c6baf673a35337d2f2cb5548dd1e33c11e7 (diff) |
Avoid raw lock/unlock calls
Diffstat (limited to 'alc/backends/solaris.cpp')
-rw-r--r-- | alc/backends/solaris.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/alc/backends/solaris.cpp b/alc/backends/solaris.cpp index 5963a4b2..79cc224d 100644 --- a/alc/backends/solaris.cpp +++ b/alc/backends/solaris.cpp @@ -91,7 +91,7 @@ int SolarisBackend::mixerProc() const ALuint frame_size{mDevice->frameSizeFromFmt()}; - lock(); + std::unique_lock<SolarisBackend> dlock{*this}; while(!mKillNow.load(std::memory_order_acquire) && mDevice->Connected.load(std::memory_order_acquire)) { @@ -99,9 +99,9 @@ int SolarisBackend::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) @@ -137,7 +137,6 @@ int SolarisBackend::mixerProc() write_ptr += wrote; } } - unlock(); return 0; } |