]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
2003-02-21 Roland McGrath <roland@redhat.com>
authorRoland McGrath <roland@gnu.org>
Sat, 22 Feb 2003 08:33:25 +0000 (08:33 +0000)
committerRoland McGrath <roland@gnu.org>
Sat, 22 Feb 2003 08:33:25 +0000 (08:33 +0000)
* pthread_create.c (start_thread): Call __libc_thread_freeres.

nptl/pthread_create.c

index bac7455af8e2c262ce98a53d2bdf0989a0d5d096..40a95c6f917b0cca133d2684e6d2455f6a575524 100644 (file)
@@ -25,6 +25,7 @@
 #include <hp-timing.h>
 #include <ldsodefs.h>
 #include <atomic.h>
+#include <libc-internal.h>
 
 #include <shlib-compat.h>
 
@@ -227,6 +228,8 @@ start_thread (void *arg)
       pd->result = pd->start_routine (pd->arg);
     }
 
+  /* Clean up any state libc stored in thread-local variables.  */
+  __libc_thread_freeres ();
 
   /* If this is the last thread we terminate the process now.  We
      do not notify the debugger, it might just irritate it if there
@@ -235,7 +238,6 @@ start_thread (void *arg)
     /* This was the last thread.  */
     exit (0);
 
-
   /* Report the death of the thread if this is wanted.  */
   if (__builtin_expect (pd->report_events, 0))
     {