Make SDL port QUIT events thread-safe
Jeffrey Pfau jeffrey@endrift.com
Sun, 20 Jul 2014 21:32:05 -0700
1 files changed,
1 insertions(+),
8 deletions(-)
jump to
M
src/platform/sdl/sdl-events.c
→
src/platform/sdl/sdl-events.c
@@ -248,14 +248,7 @@
void GBASDLHandleEvent(struct GBAThread* context, struct GBASDLEvents* sdlContext, const union SDL_Event* event) { switch (event->type) { case SDL_QUIT: - // FIXME: this isn't thread-safe - if (context->debugger) { - context->debugger->state = DEBUGGER_EXITING; - } - MutexLock(&context->stateMutex); - context->state = THREAD_EXITING; - ConditionWake(&context->stateCond); - MutexUnlock(&context->stateMutex); + GBAThreadEnd(context); break; #if SDL_VERSION_ATLEAST(2, 0, 0) case SDL_WINDOWEVENT: