* threads.c (create_thread): Don't unwind dynwind chain of parent
authorMikael Djurfeldt <djurfeldt@nada.kth.se>
Wed, 22 Jan 2003 10:29:28 +0000 (10:29 +0000)
committerMikael Djurfeldt <djurfeldt@nada.kth.se>
Wed, 22 Jan 2003 10:29:28 +0000 (10:29 +0000)
thread before creation.  Just start the new thread with an empty
dynwind chain.

libguile/ChangeLog
libguile/threads.c

index 26df1f9..53db3c1 100644 (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>
 
        * evalext.c, evalext.h (scm_self_evaluating_p): New function.
index 2534150..ba4d2cb 100644 (file)
@@ -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;