commit 4fe5d19888549978fac739e61b08ae7b4e5adfa0
Author: Thomas Jarosch <tomj@simonv.com>
Date:   Mon Feb 28 01:13:03 2011 +0100

    Fix hang in sim/SDL app build if sigaltstack is used

    This affects trunk as it tries to use sigaltstack by default.

    We shouldn't call sim_kernel_shutdown() from the SDL event thread, other
    rockbox threads still might need the IRQ mutex which is destroyed in there.

    Implemented workaround:
    - Don't free the mutex in sim_kernel_shutdown()
      if sigaltstack is active. Will be cleaned up by the OS later on.

    Proper solution:
    - Find a better place in the main rockbox code
      to call sim_kernel_shutdown(), triggered by
      an event from the SDL event thread.

      The proper place needs discussion.

diff --git a/firmware/target/hosted/sdl/kernel-sdl.c b/firmware/target/hosted/sdl/kernel-sdl.c
index 4fb1aed..443c57b 100644
--- a/firmware/target/hosted/sdl/kernel-sdl.c
+++ b/firmware/target/hosted/sdl/kernel-sdl.c
@@ -149,10 +149,11 @@ void sim_kernel_shutdown(void)
 #ifndef HAVE_SDL_THREADS
     do_exit = true;
     SDL_CondSignal(wfi_cond);
-#endif
+#else
     disable_irq(); 
     SDL_DestroyMutex(sim_irq_mtx);
     SDL_DestroyCond(sim_thread_cond); 
+#endif
 }

 Uint32 tick_timer(Uint32 interval, void *param)