summaryrefslogtreecommitdiff
path: root/linuxthreads/pthread.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-12-17 23:52:56 +0000
committerUlrich Drepper <drepper@redhat.com>2003-12-17 23:52:56 +0000
commite796f92f68585f61412f569e4b4f49b5e21d80df (patch)
treeb3cb5d9bf8e91e54d6d443330b2bad65ac867580 /linuxthreads/pthread.c
parent0278652840d0b09297986baee97ab46c136f304c (diff)
Update.
2003-12-17 Jakub Jelinek <jakub@redhat.com> * malloc/mtrace.c (tr_old_memalign_hook): New variable. (tr_memalignhook): New function. (mtrace): Register tr_memalignhook. (muntrace): Deregister tr_memalignhook. * malloc/malloc.c (__posix_memalign): If __memalign_hook != NULL, call it directly instead of memalign_internal. 2003-12-17 Ulrich Drepper <drepper@redhat.com> * misc/mntent_r.c: Change encoding to match recently change decoder. Patch by Alexander Achenbach <xela@slit.de>. 2003-12-16 Steven Munroe <sjmunroe@us.ibm.com> * sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h: Correct definition of vrregset_t. 2003-12-16 Steven Munroe <sjmunroe@us.ibm.com> * sysdeps/unix/sysv/linux/powerpc/sys/procfs.h [!__PPC64_ELF_H]: Extent conditional to include typedef elf_vrreg_t. 2002-12-17 Paolo Bonzini <bonzini@gnu.org> * posix/regexec.c (re_search_internal): Limit search to the beginning of the buffer if the initial states are empty for contexts that do not include CONTEXT_BEGBUF or, if !preg->newline_anchor, that do not include any one of CONTEXT_BEGBUF and CONTEXT_NEWLINE.
Diffstat (limited to 'linuxthreads/pthread.c')
-rw-r--r--linuxthreads/pthread.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/linuxthreads/pthread.c b/linuxthreads/pthread.c
index 11d2ef7dd1..124aa5243d 100644
--- a/linuxthreads/pthread.c
+++ b/linuxthreads/pthread.c
@@ -654,7 +654,7 @@ int __pthread_initialize_manager(void)
#ifdef USE_TLS
/* Allocate memory for the thread descriptor and the dtv. */
- tcbp = _dl_allocate_tls (NULL);
+ tcbp = _dl_allocate_tls (NULL);
if (tcbp == NULL) {
free(__pthread_manager_thread_bos);
__libc_close(manager_pipe[0]);
@@ -783,6 +783,9 @@ int __pthread_initialize_manager(void)
#endif
}
if (__builtin_expect (pid, 0) == -1) {
+#ifdef USE_TLS
+ _dl_deallocate_tls (tcbp, true);
+#endif
free(__pthread_manager_thread_bos);
__libc_close(manager_pipe[0]);
__libc_close(manager_pipe[1]);
@@ -1014,8 +1017,16 @@ static void pthread_onexit_process(int retcode, void *arg)
waitpid(__pthread_manager_thread.p_pid, NULL, __WCLONE);
#endif
/* Since all threads have been asynchronously terminated
- (possibly holding locks), free cannot be used any more. */
- /*free (__pthread_manager_thread_bos);*/
+ (possibly holding locks), free cannot be used any more.
+ For mtrace, we'd like to print something though. */
+ /* #ifdef USE_TLS
+ tcbhead_t *tcbp = (tcbhead_t *) manager_thread;
+ # if TLS_DTV_AT_TP
+ tcbp = (tcbhead_t) ((char *) tcbp + TLS_PRE_TCB_SIZE);
+ # endif
+ _dl_deallocate_tls (tcbp, true);
+ #endif
+ free (__pthread_manager_thread_bos); */
__pthread_manager_thread_bos = __pthread_manager_thread_tos = NULL;
}
}