mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Merge pull request #3794 from EmptyChaos/frame-advance-race
Core: Add synchronization to state changes (Fix Frame Step and FIFO Player - Issue 8718)
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)
|
||||
|
@ -2,6 +2,7 @@
|
||||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <QAbstractEventDispatcher>
|
||||
#include <QApplication>
|
||||
|
||||
#include "Core/BootManager.h"
|
||||
@ -20,6 +21,12 @@ int main(int argc, char* argv[])
|
||||
UICommon::Init();
|
||||
Resources::Init();
|
||||
|
||||
// Whenever the event loop is about to go to sleep, dispatch the jobs
|
||||
// queued in the Core first.
|
||||
QObject::connect(QAbstractEventDispatcher::instance(),
|
||||
&QAbstractEventDispatcher::aboutToBlock,
|
||||
&app, &Core::HostDispatchJobs);
|
||||
|
||||
MainWindow win;
|
||||
win.show();
|
||||
int retval = app.exec();
|
||||
|
Reference in New Issue
Block a user