Windows: Trigger StopThread() on shutdown.

Otherwise, we end up hanging in the loop waiting for emuThreadState to
become STOPPED.  It actually has, but ThreadFrame() will block until a new
frame is queued... while will never happen, because the emuthread has
stopped.
This commit is contained in:
Unknown W. Brackets committed 2018-02-10 16:55:44 -08:00
1 parent 3c93eaf164
commit 2bec3bf3ac
4 files changed
+10

No files matched your search

+3
View File
@@ -86,6 +86,9 @@ static void EmuThreadFunc(GraphicsContext *graphicsContext) {
emuThreadState = (int)EmuThreadState::STOPPED;
NativeShutdownGraphics();
// Ask the main thread to stop. This prevents a hang on a race condition.
graphicsContext->StopThread();
}
static void EmuThreadStart(GraphicsContext *graphicsContext) {