summaryrefslogtreecommitdiff
path: root/pthread/pt-exit.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2007-06-13 00:00:00 +0200
committerThomas Schwinge <thomas@schwinge.name>2011-10-20 16:51:57 +0200
commit577976c386d89696ec392fdfbb77ea153ddd6588 (patch)
treeb386ad39ea74625e531e74340001782731e39364 /pthread/pt-exit.c
parentb46bf7d8865dc55842a68f30f64ac064daf87441 (diff)
TLS support for libpthread, Mach/Hurd (x86).
* Makefile (CFLAGS): Define ENABLE_TLS. * pthread/pt-create.c (__pthread_create_internal) [ENABLE_TLS]: Call into glibc to allocate static TLS block. * pthread/pt-exit.c (pthread_exit) [ENABLE_TLS]: Call into glibc to deallocate static TLS block. * pthread/pt-internal.h [ENABLE_TLS] (tcbhead_t): New structure; as in glibc. (__pthread) [ENABLE_TLS]: Add TCB member. [ENABLE_TLS] (_dl_allocate_tls, _dl_deallocate_tls): Declare; from glibc. * sysdeps/mach/hurd/pt-sysdep.h (__thread_set_pcsp): Rename to __thread_set_pcsptp. Add SET_TP and TP parameters. Change all callers. * sysdeps/mach/hurd/i386/pt-machdep.c (__thread_set_pcsptp): Imlement TLS support. * sysdeps/mach/hurd/i386/pt-setup.c (__pthread_setup): Likewise.
Diffstat (limited to 'pthread/pt-exit.c')
-rw-r--r--pthread/pt-exit.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/pthread/pt-exit.c b/pthread/pt-exit.c
index 7484ffd..941526a 100644
--- a/pthread/pt-exit.c
+++ b/pthread/pt-exit.c
@@ -1,5 +1,5 @@
/* Thread termination.
- Copyright (C) 2000, 2002, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2002, 2005, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -70,6 +70,10 @@ pthread_exit (void *status)
if (self->cancel_state == PTHREAD_CANCEL_ENABLE && self->cancel_pending)
status = PTHREAD_CANCELED;
+#ifdef ENABLE_TLS
+ if (self->tcb)
+ _dl_deallocate_tls (self->tcb, 1);
+#endif /* ENABLE_TLS */
__pthread_thread_dealloc (self);
switch (self->state)