1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-01 12:20:26 +02:00

* threads.c (create_thread): Don't unwind dynwind chain of parent

thread before creation.  Just start the new thread with an empty
dynwind chain.
This commit is contained in:
Mikael Djurfeldt 2003-01-22 10:29:28 +00:00
parent 51407fa0b7
commit b4debead6a
2 changed files with 9 additions and 8 deletions

View file

@ -1,3 +1,9 @@
2003-01-22 Mikael Djurfeldt <djurfeldt@nada.kth.se>
* 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 <djurfeldt@nada.kth.se> 2003-01-20 Mikael Djurfeldt <djurfeldt@nada.kth.se>
* evalext.c, evalext.h (scm_self_evaluating_p): New function. * evalext.c, evalext.h (scm_self_evaluating_p): New function.

View file

@ -373,15 +373,11 @@ create_thread (scm_t_catch_body body, void *body_data,
{ {
scm_t_thread th; scm_t_thread th;
SCM root, old_winds; SCM root;
launch_data *data; launch_data *data;
scm_thread *t; scm_thread *t;
int err; int err;
/* Unwind wind chain. */
old_winds = scm_dynwinds;
scm_dowinds (SCM_EOL, scm_ilength (scm_root->dynwinds));
/* Allocate thread locals. */ /* Allocate thread locals. */
root = scm_make_root (scm_root->handle); root = scm_make_root (scm_root->handle);
data = scm_malloc (sizeof (launch_data)); 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); t->root = SCM_ROOT_STATE (root);
/* disconnect from parent, to prevent remembering dead threads */ /* disconnect from parent, to prevent remembering dead threads */
t->root->parent = SCM_BOOL_F; 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 /* In order to avoid the need of synchronization between parent
and child thread, we need to insert the child into all_threads 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); scm_i_plugin_mutex_unlock (&thread_admin_mutex);
} }
/* Return to old dynamic context. */
scm_dowinds (old_winds, - scm_ilength (old_winds));
if (err) if (err)
{ {
errno = err; errno = err;