From b4debead6a06a423e8dee46370c24f7df7e20a55 Mon Sep 17 00:00:00 2001 From: Mikael Djurfeldt Date: Wed, 22 Jan 2003 10:29:28 +0000 Subject: [PATCH] * threads.c (create_thread): Don't unwind dynwind chain of parent thread before creation. Just start the new thread with an empty dynwind chain. --- libguile/ChangeLog | 6 ++++++ libguile/threads.c | 11 +++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 26df1f901..53db3c1cc 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,9 @@ +2003-01-22 Mikael Djurfeldt + + * threads.c (create_thread): Don't unwind dynwind chain of parent + thread before creation. Just start the new thread with an empty + dynwind chain. + 2003-01-20 Mikael Djurfeldt * evalext.c, evalext.h (scm_self_evaluating_p): New function. diff --git a/libguile/threads.c b/libguile/threads.c index 253415016..ba4d2cbe9 100644 --- a/libguile/threads.c +++ b/libguile/threads.c @@ -373,15 +373,11 @@ create_thread (scm_t_catch_body body, void *body_data, { scm_t_thread th; - SCM root, old_winds; + SCM root; launch_data *data; scm_thread *t; int err; - /* Unwind wind chain. */ - old_winds = scm_dynwinds; - scm_dowinds (SCM_EOL, scm_ilength (scm_root->dynwinds)); - /* Allocate thread locals. */ root = scm_make_root (scm_root->handle); data = scm_malloc (sizeof (launch_data)); @@ -399,6 +395,8 @@ create_thread (scm_t_catch_body body, void *body_data, t->root = SCM_ROOT_STATE (root); /* disconnect from parent, to prevent remembering dead threads */ t->root->parent = SCM_BOOL_F; + /* start with an empty dynwind chain */ + t->root->dynwinds = SCM_EOL; /* In order to avoid the need of synchronization between parent and child thread, we need to insert the child into all_threads @@ -427,9 +425,6 @@ create_thread (scm_t_catch_body body, void *body_data, scm_i_plugin_mutex_unlock (&thread_admin_mutex); } - /* Return to old dynamic context. */ - scm_dowinds (old_winds, - scm_ilength (old_winds)); - if (err) { errno = err;