From fe027a96fb183e644b2a3f22d79356228a0fc1f1 Mon Sep 17 00:00:00 2001 From: Merry Date: Thu, 7 Apr 2022 19:30:55 +0100 Subject: [PATCH] common: Replace lock_guard with scoped_lock --- src/common/threadsafe_queue.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/threadsafe_queue.h b/src/common/threadsafe_queue.h index 2754d585c..8217e2bda 100644 --- a/src/common/threadsafe_queue.h +++ b/src/common/threadsafe_queue.h @@ -54,7 +54,7 @@ public: // line before cv.wait // TODO(bunnei): This can be replaced with C++20 waitable atomics when properly supported. // See discussion on https://github.com/yuzu-emu/yuzu/pull/3173 for details. - std::lock_guard lock{cv_mutex}; + std::scoped_lock lock{cv_mutex}; cv.notify_one(); } @@ -157,7 +157,7 @@ public: template void Push(Arg&& t) { - std::lock_guard lock{write_lock}; + std::scoped_lock lock{write_lock}; spsc_queue.Push(t); }