mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-01 03:57:17 +01:00
EmuThread: Run the graphics context's ThreadStart before starting the emu thread
On OpenGL the render thread's ThreadStart fills in the GL strings and picks the buffer strategy, while the emu thread, started just before it, could already be in NativeInitGraphics reading them. A Play report crashed walking the strings map in BuildReportingInfo. ThreadStart also resets the exit flags, which could undo an early exit by the emu thread. Libretro already starts its emu thread in this order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e10ebbeb44
commit
ad9c65ae39
1 file changed
+3
-2
+3
-2
@@ -79,9 +79,10 @@ static void EmuThreadFunc(GraphicsContext *graphicsContext, Application *applica
|
||||
std::thread EmuThread_Start(GraphicsContext *graphicsContext, Application *application, std::function<bool(GraphicsContext *)> frame) {
|
||||
INFO_LOG(Log::System, "EmuTread_Start");
|
||||
_dbg_assert_(g_emuThreadState == EmuThreadState::STOPPED);
|
||||
std::thread emuThread = std::thread(&EmuThreadFunc, graphicsContext, application, frame);
|
||||
// Before the emu thread exists: ThreadStart sets up state that NativeInitGraphics reads (the GL
|
||||
// strings for reporting), and resets the exit flags the emu thread sets.
|
||||
graphicsContext->ThreadStart();
|
||||
return emuThread;
|
||||
return std::thread(&EmuThreadFunc, graphicsContext, application, frame);
|
||||
}
|
||||
|
||||
// This is useful when the render thread is in control.
|
||||
|
||||
Reference in new issue
Block a user