all repos — mgba @ 6e62ba8bb260ab39ff31dbdf5e0e000c72ffaba2

mGBA Game Boy Advance Emulator

Qt: Fix deadlock while telling GL thread to stop
Jeffrey Pfau jeffrey@endrift.com
Sun, 09 Nov 2014 16:36:36 -0800
commit

6e62ba8bb260ab39ff31dbdf5e0e000c72ffaba2

parent

c2564c77a9902fa0d05fd8fe0f6a1650959d3546

1 files changed, 4 insertions(+), 0 deletions(-)

jump to
M src/platform/qt/Display.cppsrc/platform/qt/Display.cpp

@@ -52,9 +52,13 @@ }

void Display::stopDrawing() { if (m_drawThread) { + GBAThreadInterrupt(m_context); + GBASyncSuspendDrawing(&m_context->sync); QMetaObject::invokeMethod(m_painter, "stop", Qt::BlockingQueuedConnection); m_drawThread->exit(); m_drawThread = nullptr; + GBASyncResumeDrawing(&m_context->sync); + GBAThreadContinue(m_context); } }