Make `scm_i_ensure_signal_delivery_thread' call in Guile mode.
authorLudovic Courtès <ludo@gnu.org>
Mon, 25 Apr 2011 14:44:54 +0000 (16:44 +0200)
committerLudovic Courtès <ludo@gnu.org>
Mon, 25 Apr 2011 14:45:22 +0000 (16:45 +0200)
* libguile/threads.c (on_thread_exit): Move
  `scm_i_ensure_signal_delivery_thread' call...
  (do_thread_exit): ... here.

libguile/threads.c

index 66869e7..4de8193 100644 (file)
@@ -613,6 +613,10 @@ do_thread_exit (void *v)
 {
   scm_i_thread *t = (scm_i_thread *) v;
 
+  /* Ensure the signal handling thread has been launched, because we might be
+     shutting it down.  This needs to be done in Guile mode.  */
+  scm_i_ensure_signal_delivery_thread ();
+
   if (!scm_is_false (t->cleanup_handler))
     {
       SCM ptr = t->cleanup_handler;
@@ -687,10 +691,6 @@ on_thread_exit (void *v)
      case but it doesn't hurt to be consistent.  */
   scm_i_pthread_setspecific (scm_i_thread_key, t);
 
-  /* Ensure the signal handling thread has been launched, because we might be
-     shutting it down.  */
-  scm_i_ensure_signal_delivery_thread ();
-
   /* Scheme-level thread finalizers and other cleanup needs to happen in
      guile mode.  */
   GC_call_with_stack_base (do_thread_exit_trampoline, t);