1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 03:30:27 +02:00

--disable-threads fix

* libguile/threads.c (do_thread_exit_trampoline, on_thread_exit):
  (scm_i_init_thread_for_guile): Only register and unregister threads
  with bdw-gc when we are building with threads support.  Thanks to
  Marijn for the report.
This commit is contained in:
Andy Wingo 2011-04-13 12:03:50 +02:00
parent c89b452993
commit 8e76ce94a2

View file

@ -661,7 +661,9 @@ static void *
do_thread_exit_trampoline (struct GC_stack_base *sb, void *v)
{
/* Won't hurt if we are already registered. */
#if SCM_USE_PTHREAD_THREADS
GC_register_my_thread (sb);
#endif
return scm_with_guile (do_thread_exit, v);
}
@ -720,7 +722,7 @@ on_thread_exit (void *v)
scm_i_pthread_setspecific (scm_i_thread_key, NULL);
#if !SCM_USE_NULL_THREADS
#if SCM_USE_PTHREAD_THREADS
GC_unregister_my_thread ();
#endif
}
@ -774,7 +776,7 @@ scm_i_init_thread_for_guile (struct GC_stack_base *base, SCM parent)
*/
scm_i_init_guile (base);
#ifdef HAVE_GC_ALLOW_REGISTER_THREADS
#if defined (HAVE_GC_ALLOW_REGISTER_THREADS) && SCM_USE_PTHREAD_THREADS
/* Allow other threads to come in later. */
GC_allow_register_threads ();
#endif
@ -789,7 +791,9 @@ scm_i_init_thread_for_guile (struct GC_stack_base *base, SCM parent)
scm_i_pthread_mutex_unlock (&scm_i_init_mutex);
/* Register this thread with libgc. */
#if SCM_USE_PTHREAD_THREADS
GC_register_my_thread (base);
#endif
guilify_self_1 (base);
guilify_self_2 (parent);