From 565f9a30053b9fb9009c20e9d86b5e5c353380c9 Mon Sep 17 00:00:00 2001 From: lizzie Date: Sun, 20 Sep 2026 13:20:40 +0000 Subject: [PATCH] 2026-09-20 13:20:40 Signed-off-by: lizzie --- src/core/hle/kernel/k_thread.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/core/hle/kernel/k_thread.cpp b/src/core/hle/kernel/k_thread.cpp index b499bd4073..3b7ede9b2a 100644 --- a/src/core/hle/kernel/k_thread.cpp +++ b/src/core/hle/kernel/k_thread.cpp @@ -1236,14 +1236,10 @@ namespace Kernel { KScopedSchedulerLock sl{kernel}; // Determine if this is the first termination request. - const bool first_request = [&]() -> bool { - // Perform an atomic compare-and-swap from false to true. - bool expected = false; - return m_termination_requested.compare_exchange_strong(expected, true); - }(); - + // Perform an atomic compare-and-swap from false to true. + bool expected = false; // If this is the first request, start termination procedure. - if (first_request) { + if (m_termination_requested.compare_exchange_strong(expected, true)) { // If the thread is in initialized state, just change state to terminated. if (this->GetState() == ThreadState::Initialized) { m_thread_state = ThreadState::Terminated;