summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Soffke <christian.soffke@gmail.com>2024-12-27 11:45:04 +0100
committerChristian Soffke <christian.soffke@gmail.com>2024-12-27 11:45:53 +0100
commit5e09a9246c84536a1f5a186bf5c3b9c62d725080 (patch)
tree3d14069a56281127813fcaf87bd902d19094413c
parentdca70e1816fd079a4a6587fe7a0b8964945203c9 (diff)
downloadrockbox-5e09a9246c.tar.gz
rockbox-5e09a9246c.zip
sdl: fix shutdown hang on MacOS when SDL threads are used
Change-Id: I2179d2beed89beba1716072fc06b9cc090118364
-rw-r--r--firmware/target/hosted/sdl/system-sdl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/firmware/target/hosted/sdl/system-sdl.c b/firmware/target/hosted/sdl/system-sdl.c
index 246a6541f7..d3ec12b909 100644
--- a/firmware/target/hosted/sdl/system-sdl.c
+++ b/firmware/target/hosted/sdl/system-sdl.c
@@ -157,6 +157,9 @@ void power_off(void)
/* since sim_thread_shutdown() grabs the mutex we need to let it free,
* otherwise SDL_WaitThread will deadlock */
struct thread_entry* t = sim_thread_unlock();
+
+ if (!evt_thread) /* no event thread on MacOS */
+ sim_thread_shutdown();
#endif
/* wait for event thread to finish */
SDL_WaitThread(evt_thread, NULL);