From 1f275eb0777d5274cea85585c7eb2f8afc63f925 Mon Sep 17 00:00:00 2001 From: Merry Date: Thu, 7 Apr 2022 19:31:32 +0100 Subject: core/hle: Replace lock_guard with scoped_lock --- src/core/hle/service/hid/controllers/npad.cpp | 2 +- src/core/hle/service/nvflinger/hos_binder_driver_server.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/core/hle/service') diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp index aa6cb34b7..4e17a952e 100644 --- a/src/core/hle/service/hid/controllers/npad.cpp +++ b/src/core/hle/service/hid/controllers/npad.cpp @@ -318,7 +318,7 @@ void Controller_NPad::OnRelease() { } void Controller_NPad::RequestPadStateUpdate(Core::HID::NpadIdType npad_id) { - std::lock_guard lock{mutex}; + std::scoped_lock lock{mutex}; auto& controller = GetControllerFromNpadIdType(npad_id); const auto controller_type = controller.device->GetNpadStyleIndex(); if (!controller.device->IsConnected()) { diff --git a/src/core/hle/service/nvflinger/hos_binder_driver_server.cpp b/src/core/hle/service/nvflinger/hos_binder_driver_server.cpp index 0c937d682..094ba2542 100644 --- a/src/core/hle/service/nvflinger/hos_binder_driver_server.cpp +++ b/src/core/hle/service/nvflinger/hos_binder_driver_server.cpp @@ -14,7 +14,7 @@ HosBinderDriverServer::HosBinderDriverServer(Core::System& system_) HosBinderDriverServer::~HosBinderDriverServer() {} u64 HosBinderDriverServer::RegisterProducer(std::unique_ptr&& binder) { - std::lock_guard lk{lock}; + std::scoped_lock lk{lock}; last_id++; @@ -24,7 +24,7 @@ u64 HosBinderDriverServer::RegisterProducer(std::unique_ptr&& } android::IBinder* HosBinderDriverServer::TryGetProducer(u64 id) { - std::lock_guard lk{lock}; + std::scoped_lock lk{lock}; if (auto search = producers.find(id); search != producers.end()) { return search->second.get(); -- cgit v1.2.3