guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] GNU Guile branch, master, updated. v2.1.0-122-g3b971a5


From: Andy Wingo
Subject: [Guile-commits] GNU Guile branch, master, updated. v2.1.0-122-g3b971a5
Date: Thu, 23 Jun 2011 11:49:59 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=3b971a59b55586a236c3621a55515d9272ee5c80

The branch, master has been updated
       via  3b971a59b55586a236c3621a55515d9272ee5c80 (commit)
       via  43adb591f4c3b30d2c59845f18f6fa19e1deeb54 (commit)
      from  78f0ef20a77dd745a8fa4c1ac1fae4d42b481adf (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 3b971a59b55586a236c3621a55515d9272ee5c80
Author: Andy Wingo <address@hidden>
Date:   Thu Jun 23 11:24:16 2011 +0200

    don't spawn the signal delivery thread in a thread-exit handler
    
    * libguile/threads.c (do_thread_exit): Remove needless spawn of the
      signal delivery thread.

commit 43adb591f4c3b30d2c59845f18f6fa19e1deeb54
Author: Andy Wingo <address@hidden>
Date:   Thu Jun 23 11:23:46 2011 +0200

    allow gc <= 7.1 to stop the signal delivery thread
    
    * configure.ac: Add a check for GC_get_suspend_signal().
    * libguile/scmsigs.c (GC_get_suspend_signal): Define a fallback
      implementation if one isn't available.
      (signal_delivery_thread): Unmask the suspend signal so that GC can
      stop the world.  Fixes test-pthread-create on libgc 7.1 and earlier.
      Thanks to Frank Terbeck <address@hidden> for the report.

-----------------------------------------------------------------------

Summary of changes:
 configure.ac       |    2 +-
 libguile/scmsigs.c |   25 +++++++++++++++++++++++++
 libguile/threads.c |    4 ----
 3 files changed, 26 insertions(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index ea3ca61..b039bb6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1311,7 +1311,7 @@ save_LIBS="$LIBS"
 LIBS="$BDW_GC_LIBS $LIBS"
 CFLAGS="$BDW_GC_CFLAGS $CFLAGS"
 
-AC_CHECK_FUNCS([GC_do_blocking GC_call_with_gc_active GC_pthread_exit 
GC_pthread_cancel GC_allow_register_threads GC_pthread_sigmask 
GC_set_start_callback])
+AC_CHECK_FUNCS([GC_do_blocking GC_call_with_gc_active GC_pthread_exit 
GC_pthread_cancel GC_allow_register_threads GC_pthread_sigmask 
GC_set_start_callback GC_get_suspend_signal])
 
 # Though the `GC_do_blocking ()' symbol is present in GC 7.1, it is not
 # declared, and has a different type (returning void instead of
diff --git a/libguile/scmsigs.c b/libguile/scmsigs.c
index 723d6a8..c324aaa 100644
--- a/libguile/scmsigs.c
+++ b/libguile/scmsigs.c
@@ -150,6 +150,26 @@ struct signal_pipe_data
   int err;
 };
 
+#ifndef HAVE_GC_GET_SUSPEND_SIGNAL
+static int
+GC_get_suspend_signal (void)
+{
+#if defined SIG_SUSPEND
+  return SIG_SUSPEND;
+#elif defined SIGPWR
+  return SIGPWR;
+#elif defined SIGLOST
+  return SIGLOST;
+#elif defined _SIGRTMIN
+  return _SIGRTMIN + 6;
+#elif defined SIGRTMIN
+  return SIGRTMIN + 6;
+#else
+#error what suspend signal to use?
+#endif
+}
+#endif /* HAVE_GC_GET_SUSPEND_SIGNAL */
+
 static void*
 read_signal_pipe_data (void * data)
 {
@@ -168,6 +188,11 @@ signal_delivery_thread (void *data)
 #if HAVE_PTHREAD_SIGMASK  /* not on mingw, see notes above */
   sigset_t all_sigs;
   sigfillset (&all_sigs);
+  /* On libgc 7.1 and earlier, GC_do_blocking doesn't actually do
+     anything.  So in that case, libgc will want to suspend the signal
+     delivery thread, so we need to allow it to do so by unmasking the
+     suspend signal.  */
+  sigdelset (&all_sigs, GC_get_suspend_signal ());
   scm_i_pthread_sigmask (SIG_SETMASK, &all_sigs, NULL);
 #endif
 
diff --git a/libguile/threads.c b/libguile/threads.c
index 9a93920..22ad829 100644
--- a/libguile/threads.c
+++ b/libguile/threads.c
@@ -631,10 +631,6 @@ 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;


hooks/post-receive
-- 
GNU Guile



reply via email to

[Prev in Thread] Current Thread [Next in Thread]