Merge pull request #13689 from JosJuice/lock-core-any-thread

Core: Let any thread call previously host-thread-only functions
This commit is contained in:
JosJuice
2025-11-16 18:35:17 +01:00
committed by GitHub
11 changed files with 103 additions and 182 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()
-2
View File
@@ -127,8 +127,6 @@ int main(int argc, char* argv[])
}
#endif
Core::DeclareAsHostThread();
#ifdef __APPLE__
// On macOS, a command line option matching the format "-psn_X_XXXXXX" is passed when
// the application is launched for the first time. This is to set the "ProcessSerialNumber",
+2 -1
View File
@@ -17,6 +17,7 @@
#include <QSize>
#include <QStyle>
#include <QStyleHints>
#include <QThread>
#include <QWidget>
#include "AudioCommon/AudioCommon.h"
@@ -76,7 +77,7 @@ Settings::Settings()
});
m_hotplug_event_hook = g_controller_interface.RegisterDevicesChangedCallback([this] {
if (Core::IsHostThread())
if (qApp->thread() == QThread::currentThread())
{
emit DevicesChanged();
}