From 29776e85da637ec4d44b2b2822d6934a50c0084b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ludovic=20Court=C3=A8s?= Date: Tue, 2 Oct 2007 16:06:25 +0000 Subject: [PATCH] Changes from arch/CVS synchronization --- ChangeLog | 2 +- NEWS | 1 + libguile/ChangeLog | 6 ++++++ libguile/threads.c | 8 +++----- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3edbcf51b..18f16fd7b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,6 @@ 2007-10-02 Ludovic Courtès - * NEWS: Mention `(ice-9 slib)' fix. + * NEWS: Mention `(ice-9 slib)' fix and threading fix. 2007-09-03 Ludovic Courtès diff --git a/NEWS b/NEWS index 889e78be5..e4fbb145b 100644 --- a/NEWS +++ b/NEWS @@ -46,6 +46,7 @@ Changes in 1.8.3 (since 1.8.2) ** Warnings about duplicate bindings now go to stderr ** A memory leak in `make-socket-address' was fixed ** Alignment issues (e.g., on SPARC) in network routines were fixed +** A threading issue that showed up at least on NetBSD was fixed ** Build problems on Solaris fixed * Implementation improvements diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 4d0fe3625..f3dd1c5f7 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,9 @@ +2007-10-02 Ludovic Courtès + + * threads.c (on_thread_exit): Don't call `scm_leave_guile ()' + since we're already in non-guile mode. Reported by Greg Toxel + for NetBSD. + 2007-10-01 Ludovic Courtès * ports.c (flush_output_port): Expect directly a port instead of diff --git a/libguile/threads.c b/libguile/threads.c index 7e1bfde7f..858a1eb3d 100644 --- a/libguile/threads.c +++ b/libguile/threads.c @@ -495,20 +495,18 @@ do_thread_exit (void *v) static void on_thread_exit (void *v) { + /* This handler is executed in non-guile mode. */ scm_i_thread *t = (scm_i_thread *)v, **tp; scm_i_pthread_setspecific (scm_i_thread_key, v); /* Unblocking the joining threads needs to happen in guile mode - since the queue is a SCM data structure. - */ + since the queue is a SCM data structure. */ scm_with_guile (do_thread_exit, v); /* Removing ourself from the list of all threads needs to happen in non-guile mode since all SCM values on our stack become - unprotected once we are no longer in the list. - */ - scm_leave_guile (); + unprotected once we are no longer in the list. */ scm_i_pthread_mutex_lock (&thread_admin_mutex); for (tp = &all_threads; *tp; tp = &(*tp)->next_thread) if (*tp == t) -- 2.20.1