From f64ebb1c1f10e8d15fcc4879d781703c86c5fb8b Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Sat, 8 Sep 2007 12:20:53 +0000 Subject: Sim I/O and threading that runs more like on target. Tweakable if any genuine slowness imitation is required for any one of them. One point of concern is the sim shutdown on an OS other than Linux just because terminating threads in a manner other than having the do it themselves is kind of dirty IMHO. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14639 a1c6a512-1295-4272-9138-f99709370657 --- uisimulator/sdl/uisdl.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'uisimulator/sdl/uisdl.c') diff --git a/uisimulator/sdl/uisdl.c b/uisimulator/sdl/uisdl.c index 052fd4af83..37a0e6fe7a 100644 --- a/uisimulator/sdl/uisdl.c +++ b/uisimulator/sdl/uisdl.c @@ -41,6 +41,8 @@ extern void app_main (void *); /* mod entry point */ extern void new_key(int key); extern void sim_tick_tasks(void); +extern void sim_io_init(void); +extern void sim_io_shutdown(void); void button_event(int key, bool pressed); @@ -167,16 +169,9 @@ bool gui_startup(void) bool gui_shutdown(void) { - int i; - - SDL_KillThread(gui_thread); SDL_RemoveTimer(tick_timer_id); - - for (i = 0; i < threadCount; i++) - { - SDL_KillThread(threads[i]); - } - + kill_sim_threads(); + sim_io_shutdown(); return true; } @@ -236,6 +231,8 @@ int main(int argc, char *argv[]) background = false; } + sim_io_init(); + if (!gui_startup()) return -1; -- cgit v1.2.3