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:
@@ -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()
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user