mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Core/Movie: Add ability to run code in Host context
EndPlayInput runs on the CPU thread so it can't directly call UpdateWantDeterminism. PlayController also tries to ChangeDisc from the CPU Thread which is also invalid. It now just pauses execution and posts a request to the Host to fix it instead. The Core itself also did dodgy things like PauseAndLock-ing from the CPU Thread and SetState from EmuThread which have been removed.
This commit is contained in:
@ -2,6 +2,8 @@
|
||||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <QAbstractEventDispatcher>
|
||||
#include <QApplication>
|
||||
#include <QMutexLocker>
|
||||
|
||||
#include "Common/Common.h"
|
||||
@ -57,7 +59,15 @@ void Host::SetRenderFullscreen(bool fullscreen)
|
||||
void Host_Message(int id)
|
||||
{
|
||||
if (id == WM_USER_STOP)
|
||||
{
|
||||
emit Host::GetInstance()->RequestStop();
|
||||
}
|
||||
else if (id == WM_USER_JOB_DISPATCH)
|
||||
{
|
||||
// Just poke the main thread to get it to wake up, job dispatch
|
||||
// will happen automatically before it goes back to sleep again.
|
||||
QAbstractEventDispatcher::instance(qApp->thread())->wakeUp();
|
||||
}
|
||||
}
|
||||
|
||||
void Host_UpdateTitle(const std::string& title)
|
||||
|
Reference in New Issue
Block a user