check for GC_allow_register_threads
authorMichael Gran <spk121@yahoo.com>
Wed, 30 Mar 2011 04:25:04 +0000 (21:25 -0700)
committerAndy Wingo <wingo@pobox.com>
Wed, 30 Mar 2011 07:21:09 +0000 (09:21 +0200)
This is not present in earlier versions of BDW-GC

* configure.ac: check for GC_allow_register_threads
* libguile/threads.c (scm_i_init_thread_for_guile): Only call
  GC_allow_register_threads if it is present.

configure.ac
libguile/threads.c

index e5b8379..4fc2553 100644 (file)
@@ -1238,7 +1238,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])
+AC_CHECK_FUNCS([GC_do_blocking GC_call_with_gc_active GC_pthread_exit GC_pthread_cancel GC_allow_register_threads])
 
 # 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
index ad5bbe1..8dc3414 100644 (file)
@@ -772,8 +772,10 @@ scm_i_init_thread_for_guile (struct GC_stack_base *base, SCM parent)
          */
          scm_i_init_guile (base);
 
+#ifdef HAVE_GC_ALLOW_REGISTER_THREADS
           /* Allow other threads to come in later.  */
           GC_allow_register_threads ();
+#endif
 
          scm_i_pthread_mutex_unlock (&scm_i_init_mutex);
        }