about summary refs log tree commit diff
path: root/linuxthreads
diff options
context:
space:
mode:
Diffstat (limited to 'linuxthreads')
-rw-r--r--linuxthreads/ChangeLog12
-rw-r--r--linuxthreads/internals.h7
-rw-r--r--linuxthreads/manager.c2
-rw-r--r--linuxthreads/pthread.c16
-rw-r--r--linuxthreads/sysdeps/i386/useldt.h3
5 files changed, 32 insertions, 8 deletions
diff --git a/linuxthreads/ChangeLog b/linuxthreads/ChangeLog
index 6072abc81c..b4f33434b1 100644
--- a/linuxthreads/ChangeLog
+++ b/linuxthreads/ChangeLog
@@ -1,4 +1,14 @@
-2000-04-29  Bruno Haible  <clisp.cons.org>
+2000-05-05  Ulrich Drepper  <drepper@redhat.com>
+
+	* internals.h (struct _pthread_descr_struct): Reorganization.
+	Allocate room for 16 pointers at head of the structure for future
+	thread-local data handling.  Move p_self member in this area.
+	* manager.c (pthread_handle_create): Adjust use of p_self.
+	* sysdeps/i386/useldt.h (THREAD_SELF): Likewise.
+	* pthread.c (__pthread_initial_thread): Adjust initialization.
+	(__pthread_manager_thread): Likewise.
+
+2000-04-29  Bruno Haible  <haible@clisp.cons.org>
 
 	* join.c (pthread_exit): Use THREAD_GETMEM_NC instead of THREAD_GETMEM
 	for eventmask larger than 1 word.
diff --git a/linuxthreads/internals.h b/linuxthreads/internals.h
index 079bf2cd64..b257be0279 100644
--- a/linuxthreads/internals.h
+++ b/linuxthreads/internals.h
@@ -124,6 +124,12 @@ typedef struct _pthread_rwlock_info {
 } pthread_readlock_info;
 
 struct _pthread_descr_struct {
+  union {
+    struct {
+      pthread_descr self;	/* Pointer to this structure */
+    } data;
+    void *__padding[16];
+  } p_header;
   pthread_descr p_nextlive, p_prevlive;
                                 /* Double chaining of active threads */
   pthread_descr p_nextwaiting;  /* Next element in the queue holding the thr */
@@ -157,7 +163,6 @@ struct _pthread_descr_struct {
   int p_userstack;		/* nonzero if the user provided the stack */
   void *p_guardaddr;		/* address of guard area or NULL */
   size_t p_guardsize;		/* size of guard area */
-  pthread_descr p_self;		/* Pointer to this structure */
   int p_nr;                     /* Index of descriptor in __pthread_handles */
   int p_report_events;		/* Nonzero if events must be reported.  */
   td_eventbuf_t p_eventbuf;     /* Data for event.  */
diff --git a/linuxthreads/manager.c b/linuxthreads/manager.c
index 33c791cdbb..0c781dea6e 100644
--- a/linuxthreads/manager.c
+++ b/linuxthreads/manager.c
@@ -385,7 +385,7 @@ static int pthread_handle_create(pthread_t *thread, const pthread_attr_t *attr,
   new_thread->p_resp = &new_thread->p_res;
   new_thread->p_guardaddr = guardaddr;
   new_thread->p_guardsize = guardsize;
-  new_thread->p_self = new_thread;
+  new_thread->p_header.data.self = new_thread;
   new_thread->p_nr = sseg;
   /* Initialize the thread handle */
   __pthread_init_lock(&__pthread_handles[sseg].h_lock);
diff --git a/linuxthreads/pthread.c b/linuxthreads/pthread.c
index a78e0c92de..0e713e74da 100644
--- a/linuxthreads/pthread.c
+++ b/linuxthreads/pthread.c
@@ -37,6 +37,11 @@
 /* Descriptor of the initial thread */
 
 struct _pthread_descr_struct __pthread_initial_thread = {
+  {
+    {
+      &__pthread_initial_thread /* pthread_descr self */
+    }
+  },
   &__pthread_initial_thread,  /* pthread_descr p_nextlive */
   &__pthread_initial_thread,  /* pthread_descr p_prevlive */
   NULL,                       /* pthread_descr p_nextwaiting */
@@ -71,7 +76,6 @@ struct _pthread_descr_struct __pthread_initial_thread = {
   0,                          /* int p_userstack */
   NULL,                       /* void * p_guardaddr */
   0,                          /* size_t p_guardsize */
-  &__pthread_initial_thread,  /* pthread_descr p_self */
   0,                          /* Always index 0 */
   0,                          /* int p_report_events */
   {{{0, }}, 0, NULL},         /* td_eventbuf_t p_eventbuf */
@@ -88,6 +92,11 @@ struct _pthread_descr_struct __pthread_initial_thread = {
    and the address for identification.  */
 
 struct _pthread_descr_struct __pthread_manager_thread = {
+  {
+    {
+      &__pthread_manager_thread /* pthread_descr self */
+    }
+  },
   NULL,                       /* pthread_descr p_nextlive */
   NULL,                       /* pthread_descr p_prevlive */
   NULL,                       /* pthread_descr p_nextwaiting */
@@ -122,7 +131,6 @@ struct _pthread_descr_struct __pthread_manager_thread = {
   0,                          /* int p_userstack */
   NULL,                       /* void * p_guardaddr */
   0,                          /* size_t p_guardsize */
-  &__pthread_manager_thread,  /* pthread_descr p_self */
   1,                          /* Always index 1 */
   0,                          /* int p_report_events */
   {{{0, }}, 0, NULL},         /* td_eventbuf_t p_eventbuf */
@@ -369,12 +377,12 @@ static void pthread_initialize(void)
   sa.sa_flags = 0;
   __sigaction(__pthread_sig_restart, &sa, NULL);
   sa.sa_handler = pthread_handle_sigcancel;
-  sa.sa_flags = 0;
+  // sa.sa_flags = 0;
   __sigaction(__pthread_sig_cancel, &sa, NULL);
   if (__pthread_sig_debug > 0) {
     sa.sa_handler = pthread_handle_sigdebug;
     sigemptyset(&sa.sa_mask);
-    sa.sa_flags = 0;
+    // sa.sa_flags = 0;
     __sigaction(__pthread_sig_debug, &sa, NULL);
   }
   /* Initially, block __pthread_sig_restart. Will be unblocked on demand. */
diff --git a/linuxthreads/sysdeps/i386/useldt.h b/linuxthreads/sysdeps/i386/useldt.h
index e6055e0128..bd527a3d3c 100644
--- a/linuxthreads/sysdeps/i386/useldt.h
+++ b/linuxthreads/sysdeps/i386/useldt.h
@@ -54,7 +54,8 @@ extern int __modify_ldt (int, struct modify_ldt_ldt_s *, size_t);
 ({									      \
   register pthread_descr __self;					      \
   __asm__ ("movl %%gs:%c1,%0" : "=r" (__self)				      \
-	   : "i" (offsetof (struct _pthread_descr_struct, p_self)));	      \
+	   : "i" (offsetof (struct _pthread_descr_struct,		      \
+			    p_header.data.self)));			      \
   __self;								      \
 })