summaryrefslogtreecommitdiff
path: root/pthread/pt-create.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2013-10-16 01:50:52 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2013-10-16 01:50:52 +0200
commit96623db8d2fe02a66ac9176354634d41aca8c07d (patch)
tree6ce5aea043ce653ef17966563496bd098b37add6 /pthread/pt-create.c
parent5396c1d55933adce68891e000d10ecb8ed168caa (diff)
Delay TLS deallocation outside thread termination
Since libc functions used up to actual thread termination (including the termination RPC itself) are to use TLS. * pthread/pt-alloc.c (initialize_pthread): Set `tcb` field of `new` to NULL. (__pthread_alloc): Deallocate TLS of to-be-reused `new` thread. * pthread/pt-create.c (__pthread_create_internal): Reset `tcb` field to NULL after deallocation. * pthread/pt-exit.c (__pthread_exit): Do not deallocate TLS.
Diffstat (limited to 'pthread/pt-create.c')
-rw-r--r--pthread/pt-create.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/pthread/pt-create.c b/pthread/pt-create.c
index a88c498..a593ad0 100644
--- a/pthread/pt-create.c
+++ b/pthread/pt-create.c
@@ -216,6 +216,7 @@ __pthread_create_internal (struct __pthread **thread,
failed_setup:
#ifdef ENABLE_TLS
_dl_deallocate_tls (pthread->tcb, 1);
+ pthread->tcb = NULL;
failed_thread_tls_alloc:
#endif /* ENABLE_TLS */
__pthread_thread_dealloc (pthread);