summaryrefslogtreecommitdiff
path: root/libguile/threads.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2011-05-13 13:33:59 +0200
committerAndy Wingo <wingo@pobox.com>2011-05-13 15:33:51 +0200
commit2002f1f84797c2c46d0634eabd5ac5fd61e13d73 (patch)
tree3fdd2301373073774373d228c4c48691c60ccd98 /libguile/threads.c
parent4d40bea6c2526c58dad4162551360e9bf323461c (diff)
downloadguile-2002f1f84797c2c46d0634eabd5ac5fd61e13d73.tar.gz
refactor do_thread_exit cleanup handler invocation
* libguile/threads.c (do_thread_exit): Redo cleanup handler call so as not to shove a SCM into a pointer.
Diffstat (limited to 'libguile/threads.c')
-rw-r--r--libguile/threads.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libguile/threads.c b/libguile/threads.c
index f49696b1d..def92811b 100644
--- a/libguile/threads.c
+++ b/libguile/threads.c
@@ -607,6 +607,13 @@ typedef struct {
#define SCM_MUTEXP(x) SCM_SMOB_PREDICATE (scm_tc16_mutex, x)
#define SCM_MUTEX_DATA(x) ((fat_mutex *) SCM_SMOB_DATA (x))
+static SCM
+call_cleanup (void *data)
+{
+ SCM *proc_p = data;
+ return scm_call_0 (*proc_p);
+}
+
/* Perform thread tear-down, in guile mode.
*/
static void *
@@ -624,7 +631,7 @@ do_thread_exit (void *v)
t->cleanup_handler = SCM_BOOL_F;
t->result = scm_internal_catch (SCM_BOOL_T,
- (scm_t_catch_body) scm_call_0, ptr,
+ call_cleanup, &ptr,
scm_handle_by_message_noexit, NULL);
}