diff options
author | bunnei <bunneidev@gmail.com> | 2022-04-08 23:01:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-08 23:01:42 +0200 |
commit | 04efd729d6b86b133d1ccacfcab77235e247f766 (patch) | |
tree | 2a896020311d81e739adf0d2803d589f88ece313 /src/core/hle/kernel | |
parent | Merge pull request #8173 from Morph1984/msvc-warn-unused-fn (diff) | |
parent | core/hle: Standardize scoped_lock initializers (diff) | |
download | yuzu-04efd729d6b86b133d1ccacfcab77235e247f766.tar yuzu-04efd729d6b86b133d1ccacfcab77235e247f766.tar.gz yuzu-04efd729d6b86b133d1ccacfcab77235e247f766.tar.bz2 yuzu-04efd729d6b86b133d1ccacfcab77235e247f766.tar.lz yuzu-04efd729d6b86b133d1ccacfcab77235e247f766.tar.xz yuzu-04efd729d6b86b133d1ccacfcab77235e247f766.tar.zst yuzu-04efd729d6b86b133d1ccacfcab77235e247f766.zip |
Diffstat (limited to 'src/core/hle/kernel')
-rw-r--r-- | src/core/hle/kernel/kernel.cpp | 16 | ||||
-rw-r--r-- | src/core/hle/kernel/time_manager.cpp | 4 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index 6387d0c29..134a0b8e9 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp @@ -99,7 +99,7 @@ struct KernelCore::Impl { // Close all open server ports. std::unordered_set<KServerPort*> server_ports_; { - std::lock_guard lk(server_ports_lock); + std::scoped_lock lk{server_ports_lock}; server_ports_ = server_ports; server_ports.clear(); } @@ -157,7 +157,7 @@ struct KernelCore::Impl { // Close kernel objects that were not freed on shutdown { - std::lock_guard lk(registered_in_use_objects_lock); + std::scoped_lock lk{registered_in_use_objects_lock}; if (registered_in_use_objects.size()) { for (auto& object : registered_in_use_objects) { object->Close(); @@ -178,7 +178,7 @@ struct KernelCore::Impl { // Track kernel objects that were not freed on shutdown { - std::lock_guard lk(registered_objects_lock); + std::scoped_lock lk{registered_objects_lock}; if (registered_objects.size()) { LOG_DEBUG(Kernel, "{} kernel objects were dangling on shutdown!", registered_objects.size()); @@ -660,7 +660,7 @@ struct KernelCore::Impl { KClientPort* port = &search->second(system.ServiceManager(), system); { - std::lock_guard lk(server_ports_lock); + std::scoped_lock lk{server_ports_lock}; server_ports.insert(&port->GetParent()->GetServerPort()); } return port; @@ -929,22 +929,22 @@ KClientPort* KernelCore::CreateNamedServicePort(std::string name) { } void KernelCore::RegisterKernelObject(KAutoObject* object) { - std::lock_guard lk(impl->registered_objects_lock); + std::scoped_lock lk{impl->registered_objects_lock}; impl->registered_objects.insert(object); } void KernelCore::UnregisterKernelObject(KAutoObject* object) { - std::lock_guard lk(impl->registered_objects_lock); + std::scoped_lock lk{impl->registered_objects_lock}; impl->registered_objects.erase(object); } void KernelCore::RegisterInUseObject(KAutoObject* object) { - std::lock_guard lk(impl->registered_in_use_objects_lock); + std::scoped_lock lk{impl->registered_in_use_objects_lock}; impl->registered_in_use_objects.insert(object); } void KernelCore::UnregisterInUseObject(KAutoObject* object) { - std::lock_guard lk(impl->registered_in_use_objects_lock); + std::scoped_lock lk{impl->registered_in_use_objects_lock}; impl->registered_in_use_objects.erase(object); } diff --git a/src/core/hle/kernel/time_manager.cpp b/src/core/hle/kernel/time_manager.cpp index aa985d820..5b8fe8eae 100644 --- a/src/core/hle/kernel/time_manager.cpp +++ b/src/core/hle/kernel/time_manager.cpp @@ -24,7 +24,7 @@ TimeManager::TimeManager(Core::System& system_) : system{system_} { } void TimeManager::ScheduleTimeEvent(KThread* thread, s64 nanoseconds) { - std::lock_guard lock{mutex}; + std::scoped_lock lock{mutex}; if (nanoseconds > 0) { ASSERT(thread); ASSERT(thread->GetState() != ThreadState::Runnable); @@ -35,7 +35,7 @@ void TimeManager::ScheduleTimeEvent(KThread* thread, s64 nanoseconds) { } void TimeManager::UnscheduleTimeEvent(KThread* thread) { - std::lock_guard lock{mutex}; + std::scoped_lock lock{mutex}; system.CoreTiming().UnscheduleEvent(time_manager_event_type, reinterpret_cast<uintptr_t>(thread)); } |