From 97e4cd1c8f5576cf5615c22e6cbbb5526000762d Mon Sep 17 00:00:00 2001 From: bunnei Date: Mon, 5 Sep 2022 18:19:30 -0700 Subject: core: hle: kernel: k_thread: Implement thread termination DPC. --- src/core/arm/arm_interface.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/core/arm/arm_interface.cpp') diff --git a/src/core/arm/arm_interface.cpp b/src/core/arm/arm_interface.cpp index 953d964399..29ba562dce 100644 --- a/src/core/arm/arm_interface.cpp +++ b/src/core/arm/arm_interface.cpp @@ -134,6 +134,14 @@ void ARM_Interface::Run() { } system.ExitDynarmicProfile(); + // If the thread is scheduled for termination, exit the thread. + if (current_thread->HasDpc()) { + if (current_thread->IsTerminationRequested()) { + current_thread->Exit(); + UNREACHABLE(); + } + } + // Notify the debugger and go to sleep if a breakpoint was hit, // or if the thread is unable to continue for any reason. if (Has(hr, breakpoint) || Has(hr, no_execute)) { -- cgit v1.2.3