From c874907eb5f82e22c05f377f70fe79a24df44f6f Mon Sep 17 00:00:00 2001 From: PixelyIon Date: Sat, 22 Oct 2022 17:17:04 +0530 Subject: [PATCH] Log and flush inside `KProcess::Kill` We want to know when the `KProcess` is being killed and flushing log during it is important since it can often result in hangs due to joining not working correctly. --- app/src/main/cpp/skyline/kernel/types/KProcess.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/cpp/skyline/kernel/types/KProcess.cpp b/app/src/main/cpp/skyline/kernel/types/KProcess.cpp index c76569a4..ff433f19 100644 --- a/app/src/main/cpp/skyline/kernel/types/KProcess.cpp +++ b/app/src/main/cpp/skyline/kernel/types/KProcess.cpp @@ -26,6 +26,9 @@ namespace skyline::kernel::type { } void KProcess::Kill(bool join, bool all, bool disableCreation) { + Logger::Warn("Killing {}{}KProcess{}", join ? "and joining " : "", all ? "all threads in " : "HOS-0 in ", disableCreation ? " with new thread creation disabled" : ""); + Logger::EmulationContext.Flush(); + bool expected{false}; if (!join && !alreadyKilled.compare_exchange_strong(expected, true)) // If the process has already been killed and we don't want to wait for it to join then just instantly return rather than waiting on the mutex