Core: Let any thread call previously host-thread-only functions

By letting threads other than the host thread use things like
CPUThreadGuard, we can do a significant cleanup in AchievementsManager
in a later commit of this pull request.

Note: Some functions still can't be called from the CPU thread (or
threads the CPU thread might block on, like the GPU thread), but can
be called from any other thread.
This commit is contained in:
JosJuice
2025-11-10 21:14:17 +01:00
parent cd4902f0ed
commit 458bb05af9
3 changed files with 94 additions and 56 deletions
+3 -1
View File
@@ -8,6 +8,7 @@
#include <QAbstractEventDispatcher>
#include <QApplication>
#include <QLocale>
#include <QThread>
#include <imgui.h>
@@ -245,7 +246,8 @@ bool Host_TASInputHasFocus()
void Host_YieldToUI()
{
qApp->processEvents(QEventLoop::ExcludeUserInputEvents);
if (qApp->thread() == QThread::currentThread())
qApp->processEvents(QEventLoop::ExcludeUserInputEvents);
}
void Host_UpdateDisasmDialog()