summaryrefslogtreecommitdiff
path: root/firmware/target
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2010-05-26 17:16:19 +0000
committerThomas Martitz <kugel@rockbox.org>2010-05-26 17:16:19 +0000
commitbc2f8bbc079b2b143c06739163ba229aedef90c9 (patch)
tree381161cdc0116db83647804ab1a1a21cda73e5d9 /firmware/target
parent6d281a38968b7092af1831d2a3e144f6c98441ce (diff)
downloadrockbox-bc2f8bbc079b2b143c06739163ba229aedef90c9.tar.gz
rockbox-bc2f8bbc079b2b143c06739163ba229aedef90c9.zip
Since the sdl to target tree move, the main thread cannot be removed anymore,
since it's now the default thread which is implicitely created by starting the sim. This caused a segfault that r26283 tried to fix. Revert r26283 and protect the main thread from being removed. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26315 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target')
-rw-r--r--firmware/target/hosted/sdl/button-sdl.c1
-rw-r--r--firmware/target/hosted/sdl/thread-sdl.c7
2 files changed, 6 insertions, 2 deletions
diff --git a/firmware/target/hosted/sdl/button-sdl.c b/firmware/target/hosted/sdl/button-sdl.c
index 629d3aa9bd..e9fc03792c 100644
--- a/firmware/target/hosted/sdl/button-sdl.c
+++ b/firmware/target/hosted/sdl/button-sdl.c
@@ -176,7 +176,6 @@ void gui_message_loop(void)
176 case SDL_QUIT: 176 case SDL_QUIT:
177 { 177 {
178 sim_exit_irq_handler(); 178 sim_exit_irq_handler();
179 SDL_Quit();
180 exit(EXIT_SUCCESS); 179 exit(EXIT_SUCCESS);
181 break; 180 break;
182 } 181 }
diff --git a/firmware/target/hosted/sdl/thread-sdl.c b/firmware/target/hosted/sdl/thread-sdl.c
index 28a9cb8d3a..da43d6ea9f 100644
--- a/firmware/target/hosted/sdl/thread-sdl.c
+++ b/firmware/target/hosted/sdl/thread-sdl.c
@@ -566,7 +566,12 @@ void remove_thread(unsigned int thread_id)
566 566
567void thread_exit(void) 567void thread_exit(void)
568{ 568{
569 remove_thread(THREAD_ID_CURRENT); 569 struct thread_entry *t = thread_id_entry(THREAD_ID_CURRENT);
570 /* the main thread cannot be removed since it's created implicitely
571 * by starting the program;
572 * it has no valid jumpbuf to exit, do nothing for now */
573 if (t != &threads[0])
574 remove_thread(t->id);
570} 575}
571 576
572void thread_wait(unsigned int thread_id) 577void thread_wait(unsigned int thread_id)