diff options
| author | EmptyChaos <EmptyChaos@users.noreply.github.com> | 2016-05-12 01:18:30 +0000 |
|---|---|---|
| committer | EmptyChaos <EmptyChaos@users.noreply.github.com> | 2016-05-13 09:23:44 +1000 |
| commit | c1944f623b5918ab45152795dea9e49f57878138 (patch) | |
| tree | b11e913d08eb36eabdeef57f45b94bedc2e2da40 /Source/Core/DolphinQt2/Host.cpp | |
| parent | e8dfc8e654f7a8a92b126bdcff9e4b86b7463ba9 (diff) | |
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.
Diffstat (limited to 'Source/Core/DolphinQt2/Host.cpp')
| -rw-r--r-- | Source/Core/DolphinQt2/Host.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Source/Core/DolphinQt2/Host.cpp b/Source/Core/DolphinQt2/Host.cpp index 389e0508b8..db74d88b39 100644 --- a/Source/Core/DolphinQt2/Host.cpp +++ b/Source/Core/DolphinQt2/Host.cpp @@ -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) |
