unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* [PATCH 1/2] check for GC_allow_register_threads
@ 2011-03-30  4:50 Mike Gran
  2011-03-30  7:34 ` Andy Wingo
  0 siblings, 1 reply; 2+ messages in thread
From: Mike Gran @ 2011-03-30  4:50 UTC (permalink / raw)
  To: guile-devel

[-- Attachment #1: Type: text/plain, Size: 411 bytes --]

GC_allow_register_threads is not present in earlier versions of BDW-GC
* configure.ac: check for GC_allow_register_threads
* libguile/gen-scmconfig.c (SCM_HAVE_GC_ALLOW_REGISTER_THREADS): new define
* libguile/threads.c (scm_i_init_thread_for_guile): use new define
 
(One of these days I should figure out a way of directly sending the output of
git-format-patch through my webmail.)
 
Thanks,
 
Mike

[-- Attachment #2: 0001-check-for-GC_allow_register_threads.patch --]
[-- Type: application/octet-stream, Size: 2244 bytes --]

From 93677af52064c84b611fefcbb8ea986c65a0c480 Mon Sep 17 00:00:00 2001
From: Michael Gran <spk121@yahoo.com>
Date: Tue, 29 Mar 2011 21:25:04 -0700
Subject: [PATCH 1/2] check for GC_allow_register_threads

This is not present in earlier versions of BDW-GC

* configure.ac: check for GC_allow_register_threads
* libguile/gen-scmconfig.c (SCM_HAVE_GC_ALLOW_REGISTER_THREADS): new define
* libguile/threads.c (scm_i_init_thread_for_guile): use new define
---
 configure.ac             |    2 +-
 libguile/gen-scmconfig.c |    6 ++++++
 libguile/threads.c       |    2 ++
 3 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index e5b8379..4fc2553 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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
diff --git a/libguile/gen-scmconfig.c b/libguile/gen-scmconfig.c
index 97066b7..386fa4a 100644
--- a/libguile/gen-scmconfig.c
+++ b/libguile/gen-scmconfig.c
@@ -330,6 +330,12 @@ main (int argc, char *argv[])
   pf ("#define SCM_HAVE_GC_PTHREAD_EXIT 0 /* 0 or 1 */\n");
 #endif
 
+#ifdef HAVE_GC_ALLOW_REGISTER_THREADS
+  pf ("#define SCM_HAVE_GC_ALLOW_REGISTER_THREADS 1 /* 0 or 1 */\n");
+#else
+  pf ("#define SCM_HAVE_GC_ALLOW_REGISTER_THREADS 0 /* 0 or 1 */\n");
+#endif
+
   pf ("\n\n/*** File system access ***/\n");
 
   pf ("/* Define to 1 if `struct dirent64' is available.  */\n");
diff --git a/libguile/threads.c b/libguile/threads.c
index ad5bbe1..764fe1c 100644
--- a/libguile/threads.c
+++ b/libguile/threads.c
@@ -772,8 +772,10 @@ scm_i_init_thread_for_guile (struct GC_stack_base *base, SCM parent)
 	  */
 	  scm_i_init_guile (base);
 
+#if SCM_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);
 	}
-- 
1.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/2] check for GC_allow_register_threads
  2011-03-30  4:50 [PATCH 1/2] check for GC_allow_register_threads Mike Gran
@ 2011-03-30  7:34 ` Andy Wingo
  0 siblings, 0 replies; 2+ messages in thread
From: Andy Wingo @ 2011-03-30  7:34 UTC (permalink / raw)
  To: Mike Gran; +Cc: guile-devel

On Wed 30 Mar 2011 06:50, Mike Gran <spk121@yahoo.com> writes:

> GC_allow_register_threads is not present in earlier versions of BDW-GC
> * configure.ac: check for GC_allow_register_threads
> * libguile/gen-scmconfig.c (SCM_HAVE_GC_ALLOW_REGISTER_THREADS): new define
> * libguile/threads.c (scm_i_init_thread_for_guile): use new define

Applied, thanks!  And your other patch.

I did make a change to this one: see, scmconfig.h is for configuration
options/choices that affect the installed header files.  For
configuration options that don't need to be installed, we can just rely
on config.h, which is what I did here.

Cheers,

Andy
-- 
http://wingolog.org/



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-03-30  7:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-30  4:50 [PATCH 1/2] check for GC_allow_register_threads Mike Gran
2011-03-30  7:34 ` Andy Wingo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).