From a107d75e38fa9040892da4255bbf959ea4296f5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 24 Aug 2025 10:27:01 +0200 Subject: [PATCH] Fix lifecycle-notification assert problem (was called from wrong thread) --- Core/Core.cpp | 3 +++ Core/System.cpp | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Core/Core.cpp b/Core/Core.cpp index e7a256b281..e7112c24e6 100644 --- a/Core/Core.cpp +++ b/Core/Core.cpp @@ -26,6 +26,7 @@ #include "Common/Profiler/Profiler.h" #include "Common/GraphicsContext.h" +#include "Common/Thread/ThreadUtil.h" #include "Common/Log.h" #include "Core/Core.h" #include "Core/Config.h" @@ -143,6 +144,8 @@ void Core_ListenLifecycle(CoreLifecycleFunc func) { } void Core_NotifyLifecycle(CoreLifecycle stage) { + AssertCurrentThreadName("EmuThread"); + if (stage == CoreLifecycle::STARTING) { Core_ResetException(); } diff --git a/Core/System.cpp b/Core/System.cpp index 627c4c686d..39292b3cc3 100644 --- a/Core/System.cpp +++ b/Core/System.cpp @@ -585,6 +585,8 @@ bool PSP_InitStart(const CoreParameter &coreParam) { _assert_msg_(!g_loadingThread.joinable(), "%s", coreParam.fileToStart.c_str()); + Core_NotifyLifecycle(CoreLifecycle::STARTING); + g_loadingThread = std::thread([error_string]() { SetCurrentThreadName("ExecLoader"); @@ -592,8 +594,6 @@ bool PSP_InitStart(const CoreParameter &coreParam) { NOTICE_LOG(Log::Boot, "PPSSPP %s", PPSSPP_GIT_VERSION); - Core_NotifyLifecycle(CoreLifecycle::STARTING); - Path filename = g_CoreParameter.fileToStart; FileLoader *loadedFile = ResolveFileLoaderTarget(ConstructFileLoader(filename));