From 52a003e9bb7c870f26436b38e62edc96385805dc Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 7 Oct 2019 23:22:06 -0700 Subject: Avoid raw lock/unlock calls --- alc/backends/dsound.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'alc/backends/dsound.cpp') diff --git a/alc/backends/dsound.cpp b/alc/backends/dsound.cpp index 19a3c604..d48b74e2 100644 --- a/alc/backends/dsound.cpp +++ b/alc/backends/dsound.cpp @@ -276,17 +276,18 @@ FORCE_ALIGN int DSoundPlayback::mixerProc() if(SUCCEEDED(err)) { - lock(); + std::unique_lock dlock{*this}; aluMixData(mDevice, WritePtr1, WriteCnt1/FrameSize); if(WriteCnt2 > 0) aluMixData(mDevice, WritePtr2, WriteCnt2/FrameSize); - unlock(); + dlock.unlock(); mBuffer->Unlock(WritePtr1, WriteCnt1, WritePtr2, WriteCnt2); } else { ERR("Buffer lock error: %#lx\n", err); + std::lock_guard _{*this}; aluHandleDisconnect(mDevice, "Failed to lock output buffer: 0x%lx", err); return 1; } -- cgit v1.2.3