From c586ac9be2edea86889b44d44cede599a0c4dba5 Mon Sep 17 00:00:00 2001 From: Salvage <29021710+Saalvage@users.noreply.github.com> Date: Fri, 9 Dec 2022 13:41:04 +0100 Subject: Remove the lock entirely as per PR discussion Correctly unlock mutex before its destruction As per https://en.cppreference.com/w/cpp/thread/mutex/~mutex destroying a locked mutex is undefined behavior and MSVC++ decides to throw in this case Swap out unique for scoped lock and readd comment --- src/core/hle/kernel/service_thread.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/core') diff --git a/src/core/hle/kernel/service_thread.cpp b/src/core/hle/kernel/service_thread.cpp index e72c3d35d..38afa720b 100644 --- a/src/core/hle/kernel/service_thread.cpp +++ b/src/core/hle/kernel/service_thread.cpp @@ -163,9 +163,6 @@ ServiceThread::Impl::~Impl() { m_wakeup_event->Signal(); m_host_thread.join(); - // Lock mutex. - m_session_mutex.lock(); - // Close all remaining sessions. for (const auto& [server_session, manager] : m_sessions) { server_session->Close(); -- cgit v1.2.3