summaryrefslogtreecommitdiff
path: root/pthread/pt-create.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2012-04-27 01:32:54 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2012-04-27 01:37:36 +0000
commit25260994c812050a5d7addf125cdc90c911ca5c1 (patch)
tree255b2ba5ba5b799b1a5f23aef17d75534103de0a /pthread/pt-create.c
parente84c82a43e671c7506401936ac097b55d0fb47bf (diff)
Store self in __thread variable instead of threadvar
* sysdeps/mach/hurd/pt-sysdep.h (_HURD_THREADVAR_THREAD): Remove macro. (___pthread_self): Declare new __thread variable. (_pthread_self): Take self pointer from ___pthread_self instead of threadvar. * sysdeps/mach/hurd/pt-sysdep.c (___pthread_self): Define new __thread variable. (init_routine): Set ___pthread_self to initial thread structure. * pthread/pt-internal.h (__pthread_setup): Add `self' parameter to `entry_point' parameter. * pthread/pt-create.c (entry_point): Add `self' parameter. Store it in ___pthread_self. * sysdeps/l4/hurd/ia32/pt-setup.c (stack_setup): Add `self parameter to `entry_point' parameter. Pass it the `thread' parameter. (__pthread_setup): Likewise. * sysdeps/l4/hurd/powerpc/pt-setup.c (struct start_info): Add `self' field. (first_entry_1): Pass `self' parameter. (stack_setup): Add `self' parameter to `entry_point' parameter, pass it the `thread' parameter. (__pthread_setup): Likewise. * sysdeps/mach/hurd/ia32/pt-setup.c (stack_setup): Pass `thread' parameter to the start routine. (stack_setup): Add `self' parameter to `entry_point' paramter.
Diffstat (limited to 'pthread/pt-create.c')
-rw-r--r--pthread/pt-create.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/pthread/pt-create.c b/pthread/pt-create.c
index ca6b66c..4d81a95 100644
--- a/pthread/pt-create.c
+++ b/pthread/pt-create.c
@@ -38,8 +38,12 @@ __atomic_t __pthread_total;
/* The entry-point for new threads. */
static void
-entry_point (void *(*start_routine)(void *), void *arg)
+entry_point (struct __pthread *self, void *(*start_routine)(void *), void *arg)
{
+#ifdef ENABLE_TLS
+ ___pthread_self = self;
+#endif
+
#ifdef HAVE_USELOCALE
/* A fresh thread needs to be bound to the global locale. */
uselocale (LC_GLOBAL_LOCALE);