summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/target/hosted/sdl/system-sdl.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/firmware/target/hosted/sdl/system-sdl.c b/firmware/target/hosted/sdl/system-sdl.c
index aa322ddf3a..37580ede7d 100644
--- a/firmware/target/hosted/sdl/system-sdl.c
+++ b/firmware/target/hosted/sdl/system-sdl.c
@@ -159,28 +159,26 @@ static int sdl_event_thread(void * param)
159 if (background && picture_surface != NULL) 159 if (background && picture_surface != NULL)
160 SDL_BlitSurface(picture_surface, NULL, gui_surface, NULL); 160 SDL_BlitSurface(picture_surface, NULL, gui_surface, NULL);
161 161
162 /* let system_init proceed */
163 SDL_SemPost((SDL_sem *)param);
164
165#if (CONFIG_PLATFORM & PLATFORM_MAEMO) 162#if (CONFIG_PLATFORM & PLATFORM_MAEMO)
166 /* Start maemo thread: Listen to display on/off events and battery monitoring */ 163 /* start maemo thread: Listen to display on/off events and battery monitoring */
167 wait_for_maemo_startup = SDL_CreateSemaphore(0); /* 0-count so it blocks */ 164 wait_for_maemo_startup = SDL_CreateSemaphore(0); /* 0-count so it blocks */
168 SDL_Thread *maemo_thread = SDL_CreateThread(maemo_thread_func, wait_for_maemo_startup); 165 SDL_Thread *maemo_thread = SDL_CreateThread(maemo_thread_func, wait_for_maemo_startup);
166
167 SDL_SemWait(wait_for_maemo_startup);
168 SDL_DestroySemaphore(wait_for_maemo_startup);
169#endif 169#endif
170 170
171 /* let system_init proceed */
172 SDL_SemPost((SDL_sem *)param);
173
171 /* 174 /*
172 * finally enter the button loop */ 175 * finally enter the button loop */
173 gui_message_loop(); 176 gui_message_loop();
174 177
175#if (CONFIG_PLATFORM & PLATFORM_MAEMO)
176 /* Ensure maemo thread is up and running */
177 SDL_SemWait(wait_for_maemo_startup);
178 SDL_DestroySemaphore(wait_for_maemo_startup);
179
180#if (CONFIG_PLATFORM & PLATFORM_MAEMO5) 178#if (CONFIG_PLATFORM & PLATFORM_MAEMO5)
181 pcm_shutdown_gstreamer(); 179 pcm_shutdown_gstreamer();
182#endif 180#endif
183 181#if (CONFIG_PLATFORM & PLATFORM_MAEMO)
184 g_main_loop_quit (maemo_main_loop); 182 g_main_loop_quit (maemo_main_loop);
185 g_main_loop_unref(maemo_main_loop); 183 g_main_loop_unref(maemo_main_loop);
186 SDL_WaitThread(maemo_thread, NULL); 184 SDL_WaitThread(maemo_thread, NULL);