aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-08-26 16:00:46 +0000
committerUlrich Drepper <drepper@redhat.com>1998-08-26 16:00:46 +0000
commit00a2f9aa41a4f2a441c3b9787ca1a7701632de5f (patch)
tree55ba2c2f0f2e630c24fd23f81029c1dbc7de3058
parent08cac4ac19abd40887afbd9d841cd96a8efbbe98 (diff)
downloadglibc-00a2f9aa41a4f2a441c3b9787ca1a7701632de5f.tar.xz
glibc-00a2f9aa41a4f2a441c3b9787ca1a7701632de5f.zip
Update.
1998-08-26 15:46 Ulrich Drepper <drepper@cygnus.com> * internals.h: Define THREAD_GETMEM and THREAD_SETMEM to default if not already defined. (struct _pthread_descr_struct): Add p_self and p_nr field. * manager.c (__pthread_handles): Define second element to point to manager thread. (__pthread_handles_num): Initialize to 2. (__pthread_manager): Use INIT_THREAD_SELF with two arguments. (pthread_start_thread): Likewise. (pthread_handle_create): Start search for free slot at entry 2. Initialize new fields p_self and p_nr. Call __clone with CLONE_PTRACE if available. (pthread_free): Call FREE_THREAD_SELF if available. * pthread.c (__pthread_initial_thread): Initialize new fields. (__pthread_manager_thread): Likewise. (__pthread_initialize_manager): Call __clone with CLONE_PTRACE. * cancel.c: Use THREAD_GETMEM and THREAD_SETMEM to access the elements of the thread descriptor. * condvar.c: Likewise. * errno.c: Likewise. * join.c: Likewise. * manager.c: Likewise. * pthread.c: Likewise. * ptlongjmp.c: Likewise. * semaphore.c: Likewise. * signals.c: Likewise. * specific.c: Likewise. * spinlock.c: Likewise. * sysdeps/alpha/pt-machine.h (INIT_THREAD_SELF): Add extra parameter. * sysdeps/i386/useldt.h: New file. * sysdeps/i386/i686/pt-machine.h: Show how to use this file. * sysdeps/sparc/sparc32/pt-machine.h: Define THREAD_GETMEM and THREAD_SETMEM using __thread_self. * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
-rw-r--r--libio/iogetline.c2
-rw-r--r--linuxthreads/ChangeLog40
-rw-r--r--linuxthreads/cancel.c50
-rw-r--r--linuxthreads/condvar.c21
-rw-r--r--linuxthreads/errno.c4
-rw-r--r--linuxthreads/internals.h9
-rw-r--r--linuxthreads/join.c15
-rw-r--r--linuxthreads/manager.c32
-rw-r--r--linuxthreads/pthread.c94
-rw-r--r--linuxthreads/ptlongjmp.c9
-rw-r--r--linuxthreads/semaphore.c5
-rw-r--r--linuxthreads/signals.c27
-rw-r--r--linuxthreads/specific.c28
-rw-r--r--linuxthreads/spinlock.c2
-rw-r--r--linuxthreads/sysdeps/alpha/pt-machine.h4
-rw-r--r--linuxthreads/sysdeps/i386/i686/pt-machine.h4
-rw-r--r--linuxthreads/sysdeps/i386/useldt.h124
-rw-r--r--linuxthreads/sysdeps/sparc/sparc32/pt-machine.h6
-rw-r--r--linuxthreads/sysdeps/sparc/sparc64/pt-machine.h6
19 files changed, 369 insertions, 113 deletions
diff --git a/libio/iogetline.c b/libio/iogetline.c
index 9b49039f58..9a5f691031 100644
--- a/libio/iogetline.c
+++ b/libio/iogetline.c
@@ -59,7 +59,7 @@ _IO_getline_info (fp, buf, n, delim, extract_delim, eof)
char *ptr = buf;
if (eof != NULL)
*eof = 0;
- while (n != 0);
+ while (n != 0)
{
_IO_ssize_t len = fp->_IO_read_end - fp->_IO_read_ptr;
if (len <= 0)
diff --git a/linuxthreads/ChangeLog b/linuxthreads/ChangeLog
index 5b4dcbd64a..00f52d6413 100644
--- a/linuxthreads/ChangeLog
+++ b/linuxthreads/ChangeLog
@@ -1,3 +1,43 @@
+1998-08-26 15:46 Ulrich Drepper <drepper@cygnus.com>
+
+ * internals.h: Define THREAD_GETMEM and THREAD_SETMEM to default if
+ not already defined.
+ (struct _pthread_descr_struct): Add p_self and p_nr field.
+ * manager.c (__pthread_handles): Define second element to point
+ to manager thread.
+ (__pthread_handles_num): Initialize to 2.
+ (__pthread_manager): Use INIT_THREAD_SELF with two arguments.
+ (pthread_start_thread): Likewise.
+ (pthread_handle_create): Start search for free slot at entry 2.
+ Initialize new fields p_self and p_nr.
+ Call __clone with CLONE_PTRACE if available.
+ (pthread_free): Call FREE_THREAD_SELF if available.
+ * pthread.c (__pthread_initial_thread): Initialize new fields.
+ (__pthread_manager_thread): Likewise.
+ (__pthread_initialize_manager): Call __clone with CLONE_PTRACE.
+
+ * cancel.c: Use THREAD_GETMEM and THREAD_SETMEM to access the
+ elements of the thread descriptor.
+ * condvar.c: Likewise.
+ * errno.c: Likewise.
+ * join.c: Likewise.
+ * manager.c: Likewise.
+ * pthread.c: Likewise.
+ * ptlongjmp.c: Likewise.
+ * semaphore.c: Likewise.
+ * signals.c: Likewise.
+ * specific.c: Likewise.
+ * spinlock.c: Likewise.
+
+ * sysdeps/alpha/pt-machine.h (INIT_THREAD_SELF): Add extra parameter.
+
+ * sysdeps/i386/useldt.h: New file.
+ * sysdeps/i386/i686/pt-machine.h: Show how to use this file.
+
+ * sysdeps/sparc/sparc32/pt-machine.h: Define THREAD_GETMEM and
+ THREAD_SETMEM using __thread_self.
+ * sysdeps/sparc/sparc64/pt-machine.h: Likewise.
+
1998-08-24 Geoff Keating <geoffk@ozemail.com.au>
* spinlock.c (__pthread_lock): Reset p_nextwaiting to NULL if it
diff --git a/linuxthreads/cancel.c b/linuxthreads/cancel.c
index eda5d88154..e9cb10cc7c 100644
--- a/linuxthreads/cancel.c
+++ b/linuxthreads/cancel.c
@@ -25,11 +25,11 @@ int pthread_setcancelstate(int state, int * oldstate)
pthread_descr self = thread_self();
if (state < PTHREAD_CANCEL_ENABLE || state > PTHREAD_CANCEL_DISABLE)
return EINVAL;
- if (oldstate != NULL) *oldstate = self->p_cancelstate;
- self->p_cancelstate = state;
- if (self->p_canceled &&
- self->p_cancelstate == PTHREAD_CANCEL_ENABLE &&
- self->p_canceltype == PTHREAD_CANCEL_ASYNCHRONOUS)
+ if (oldstate != NULL) *oldstate = THREAD_GETMEM(self, p_cancelstate);
+ THREAD_SETMEM(self, p_cancelstate, state);
+ if (THREAD_GETMEM(self, p_canceled) &&
+ THREAD_GETMEM(self, p_cancelstate) == PTHREAD_CANCEL_ENABLE &&
+ THREAD_GETMEM(self, p_canceltype) == PTHREAD_CANCEL_ASYNCHRONOUS)
pthread_exit(PTHREAD_CANCELED);
return 0;
}
@@ -39,11 +39,11 @@ int pthread_setcanceltype(int type, int * oldtype)
pthread_descr self = thread_self();
if (type < PTHREAD_CANCEL_DEFERRED || type > PTHREAD_CANCEL_ASYNCHRONOUS)
return EINVAL;
- if (oldtype != NULL) *oldtype = self->p_canceltype;
- self->p_canceltype = type;
- if (self->p_canceled &&
- self->p_cancelstate == PTHREAD_CANCEL_ENABLE &&
- self->p_canceltype == PTHREAD_CANCEL_ASYNCHRONOUS)
+ if (oldtype != NULL) *oldtype = THREAD_GETMEM(self, p_canceltype);
+ THREAD_SETMEM(self, p_canceltype, type);
+ if (THREAD_GETMEM(self, p_canceled) &&
+ THREAD_GETMEM(self, p_cancelstate) == PTHREAD_CANCEL_ENABLE &&
+ THREAD_GETMEM(self, p_canceltype) == PTHREAD_CANCEL_ASYNCHRONOUS)
pthread_exit(PTHREAD_CANCELED);
return 0;
}
@@ -68,7 +68,8 @@ int pthread_cancel(pthread_t thread)
void pthread_testcancel(void)
{
pthread_descr self = thread_self();
- if (self->p_canceled && self->p_cancelstate == PTHREAD_CANCEL_ENABLE)
+ if (THREAD_GETMEM(self, p_canceled)
+ && THREAD_GETMEM(self, p_cancelstate) == PTHREAD_CANCEL_ENABLE)
pthread_exit(PTHREAD_CANCELED);
}
@@ -78,8 +79,8 @@ void _pthread_cleanup_push(struct _pthread_cleanup_buffer * buffer,
pthread_descr self = thread_self();
buffer->routine = routine;
buffer->arg = arg;
- buffer->prev = self->p_cleanup;
- self->p_cleanup = buffer;
+ buffer->prev = THREAD_GETMEM(self, p_cleanup);
+ THREAD_SETMEM(self, p_cleanup, buffer);
}
void _pthread_cleanup_pop(struct _pthread_cleanup_buffer * buffer,
@@ -87,7 +88,7 @@ void _pthread_cleanup_pop(struct _pthread_cleanup_buffer * buffer,
{
pthread_descr self = thread_self();
if (execute) buffer->routine(buffer->arg);
- self->p_cleanup = buffer->prev;
+ THREAD_SETMEM(self, p_cleanup, buffer->prev);
}
void _pthread_cleanup_push_defer(struct _pthread_cleanup_buffer * buffer,
@@ -96,10 +97,10 @@ void _pthread_cleanup_push_defer(struct _pthread_cleanup_buffer * buffer,
pthread_descr self = thread_self();
buffer->routine = routine;
buffer->arg = arg;
- buffer->canceltype = self->p_canceltype;
- buffer->prev = self->p_cleanup;
- self->p_canceltype = PTHREAD_CANCEL_DEFERRED;
- self->p_cleanup = buffer;
+ buffer->canceltype = THREAD_GETMEM(self, p_canceltype);
+ buffer->prev = THREAD_GETMEM(self, p_cleanup);
+ THREAD_SETMEM(self, p_canceltype, PTHREAD_CANCEL_DEFERRED);
+ THREAD_SETMEM(self, p_cleanup, buffer);
}
void _pthread_cleanup_pop_restore(struct _pthread_cleanup_buffer * buffer,
@@ -107,11 +108,11 @@ void _pthread_cleanup_pop_restore(struct _pthread_cleanup_buffer * buffer,
{
pthread_descr self = thread_self();
if (execute) buffer->routine(buffer->arg);
- self->p_cleanup = buffer->prev;
- self->p_canceltype = buffer->canceltype;
- if (self->p_canceled &&
- self->p_cancelstate == PTHREAD_CANCEL_ENABLE &&
- self->p_canceltype == PTHREAD_CANCEL_ASYNCHRONOUS)
+ THREAD_SETMEM(self, p_cleanup, buffer->prev);
+ THREAD_SETMEM(self, p_canceltype, buffer->canceltype);
+ if (THREAD_GETMEM(self, p_canceled) &&
+ THREAD_GETMEM(self, p_cancelstate) == PTHREAD_CANCEL_ENABLE &&
+ THREAD_GETMEM(self, p_canceltype) == PTHREAD_CANCEL_ASYNCHRONOUS)
pthread_exit(PTHREAD_CANCELED);
}
@@ -119,7 +120,8 @@ void __pthread_perform_cleanup(void)
{
pthread_descr self = thread_self();
struct _pthread_cleanup_buffer * c;
- for (c = self->p_cleanup; c != NULL; c = c->prev) c->routine(c->arg);
+ for (c = THREAD_GETMEM(self, p_cleanup); c != NULL; c = c->prev)
+ c->routine(c->arg);
}
#ifndef PIC
diff --git a/linuxthreads/condvar.c b/linuxthreads/condvar.c
index 480a8e426e..773d7144f0 100644
--- a/linuxthreads/condvar.c
+++ b/linuxthreads/condvar.c
@@ -50,7 +50,8 @@ int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
suspend_with_cancellation(self);
pthread_mutex_lock(mutex);
/* This is a cancellation point */
- if (self->p_canceled && self->p_cancelstate == PTHREAD_CANCEL_ENABLE) {
+ if (THREAD_GETMEM(self, p_canceled)
+ && THREAD_GETMEM(self, p_cancelstate) == PTHREAD_CANCEL_ENABLE) {
/* Remove ourselves from the waiting queue if we're still on it */
__pthread_lock(&cond->c_lock);
remove_from_queue(&cond->c_waiting, self);
@@ -77,11 +78,12 @@ pthread_cond_timedwait_relative(pthread_cond_t *cond,
pthread_mutex_unlock(mutex);
/* Set up a longjmp handler for the restart and cancel signals */
if (sigsetjmp(jmpbuf, 1) == 0) {
- self->p_signal_jmp = &jmpbuf;
- self->p_cancel_jmp = &jmpbuf;
- self->p_signal = 0;
+ THREAD_SETMEM(self, p_signal_jmp, &jmpbuf);
+ THREAD_SETMEM(self, p_cancel_jmp, &jmpbuf);
+ THREAD_SETMEM(self, p_signal, 0);
/* Check for cancellation */
- if (self->p_canceled && self->p_cancelstate == PTHREAD_CANCEL_ENABLE) {
+ if (THREAD_GETMEM(self, p_canceled)
+ && THREAD_GETMEM(self, p_cancelstate) == PTHREAD_CANCEL_ENABLE) {
retsleep = -1;
} else {
/* Unblock the restart signal */
@@ -96,14 +98,15 @@ pthread_cond_timedwait_relative(pthread_cond_t *cond,
} else {
retsleep = -1;
}
- self->p_signal_jmp = NULL;
- self->p_cancel_jmp = NULL;
+ THREAD_SETMEM(self, p_signal_jmp, NULL);
+ THREAD_SETMEM(self, p_cancel_jmp, NULL);
/* Here, either the condition was signaled (self->p_signal != 0)
or we got canceled (self->p_canceled != 0)
or the timeout occurred (retsleep == 0)
or another interrupt occurred (retsleep == -1) */
/* This is a cancellation point */
- if (self->p_canceled && self->p_cancelstate == PTHREAD_CANCEL_ENABLE) {
+ if (THREAD_GETMEM(self, p_canceled)
+ && THREAD_GETMEM(self, p_cancelstate) == PTHREAD_CANCEL_ENABLE) {
__pthread_lock(&cond->c_lock);
remove_from_queue(&cond->c_waiting, self);
__pthread_unlock(&cond->c_lock);
@@ -111,7 +114,7 @@ pthread_cond_timedwait_relative(pthread_cond_t *cond,
pthread_exit(PTHREAD_CANCELED);
}
/* If not signaled: also remove ourselves and return an error code */
- if (self->p_signal == 0) {
+ if (THREAD_GETMEM(self, p_signal) == 0) {
__pthread_lock(&cond->c_lock);
remove_from_queue(&cond->c_waiting, self);
__pthread_unlock(&cond->c_lock);
diff --git a/linuxthreads/errno.c b/linuxthreads/errno.c
index 3619aa87b6..746474860c 100644
--- a/linuxthreads/errno.c
+++ b/linuxthreads/errno.c
@@ -22,11 +22,11 @@
int * __errno_location()
{
pthread_descr self = thread_self();
- return self->p_errnop;
+ return THREAD_GETMEM (self, p_errnop);
}
int * __h_errno_location()
{
pthread_descr self = thread_self();
- return self->p_h_errnop;
+ return THREAD_GETMEM (self, p_h_errnop);
}
diff --git a/linuxthreads/internals.h b/linuxthreads/internals.h
index 62c14c606d..d418fe2211 100644
--- a/linuxthreads/internals.h
+++ b/linuxthreads/internals.h
@@ -25,6 +25,13 @@
#include "pt-machine.h"
+#ifndef THREAD_GETMEM
+# define THREAD_GETMEM(descr, member) descr->member
+#endif
+#ifndef THREAD_SETMEM
+# define THREAD_SETMEM(descr, member, value) descr->member = (value)
+#endif
+
/* Arguments passed to thread creation routine */
struct pthread_start_args {
@@ -90,6 +97,8 @@ 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 */
};
/* The type of thread handles. */
diff --git a/linuxthreads/join.c b/linuxthreads/join.c
index 4fadd85299..482f0d1dcc 100644
--- a/linuxthreads/join.c
+++ b/linuxthreads/join.c
@@ -30,18 +30,18 @@ void pthread_exit(void * retval)
/* Reset the cancellation flag to avoid looping if the cleanup handlers
contain cancellation points */
- self->p_canceled = 0;
+ THREAD_SETMEM(self, p_canceled, 0);
/* Call cleanup functions and destroy the thread-specific data */
__pthread_perform_cleanup();
__pthread_destroy_specifics();
/* Store return value */
- __pthread_lock(self->p_lock);
- self->p_retval = retval;
+ __pthread_lock(THREAD_GETMEM(self, p_lock));
+ THREAD_SETMEM(self, p_retval, retval);
/* Say that we've terminated */
- self->p_terminated = 1;
+ THREAD_SETMEM(self, p_terminated, 1);
/* See if someone is joining on us */
- joining = self->p_joining;
- __pthread_unlock(self->p_lock);
+ joining = THREAD_GETMEM(self, p_joining);
+ __pthread_unlock(THREAD_GETMEM(self, p_lock));
/* Restart joining thread if any */
if (joining != NULL) restart(joining);
/* If this is the initial thread, block until all threads have terminated.
@@ -86,7 +86,8 @@ int pthread_join(pthread_t thread_id, void ** thread_return)
__pthread_unlock(&handle->h_lock);
suspend_with_cancellation(self);
/* This is a cancellation point */
- if (self->p_canceled && self->p_cancelstate == PTHREAD_CANCEL_ENABLE) {
+ if (THREAD_GETMEM(self, p_canceled)
+ && THREAD_GETMEM(self, p_cancelstate) == PTHREAD_CANCEL_ENABLE) {
th->p_joining = NULL;
pthread_exit(PTHREAD_CANCELED);
}
diff --git a/linuxthreads/manager.c b/linuxthreads/manager.c
index 41acf01b29..d145395407 100644
--- a/linuxthreads/manager.c
+++ b/linuxthreads/manager.c
@@ -36,14 +36,15 @@
/* Array of active threads. Entry 0 is reserved for the initial thread. */
struct pthread_handle_struct __pthread_handles[PTHREAD_THREADS_MAX] =
-{ { LOCK_INITIALIZER, &__pthread_initial_thread, 0}, /* All NULLs */ };
+{ { LOCK_INITIALIZER, &__pthread_initial_thread, 0},
+ { LOCK_INITIALIZER, &__pthread_manager_thread, 0}, /* All NULLs */ };
/* Indicate whether at least one thread has a user-defined stack (if 1),
or if all threads have stacks supplied by LinuxThreads (if 0). */
int __pthread_nonstandard_stacks = 0;
/* Number of active entries in __pthread_handles (used by gdb) */
-volatile int __pthread_handles_num = 1;
+volatile int __pthread_handles_num = 2;
/* Whether to use debugger additional actions for thread creation
(set to 1 by gdb) */
@@ -95,7 +96,7 @@ int __pthread_manager(void *arg)
/* If we have special thread_self processing, initialize it. */
#ifdef INIT_THREAD_SELF
- INIT_THREAD_SELF(&__pthread_manager_thread);
+ INIT_THREAD_SELF(&__pthread_manager_thread, 1);
#endif
/* Set the error variable. */
__pthread_manager_thread.p_errnop = &__pthread_manager_thread.p_errno;
@@ -179,17 +180,18 @@ static int pthread_start_thread(void *arg)
void * outcome;
/* Initialize special thread_self processing, if any. */
#ifdef INIT_THREAD_SELF
- INIT_THREAD_SELF(self);
+ INIT_THREAD_SELF(self, self->p_nr);
#endif
/* Make sure our pid field is initialized, just in case we get there
before our father has initialized it. */
- self->p_pid = __getpid();
+ THREAD_SETMEM(self, p_pid, __getpid());
/* Initial signal mask is that of the creating thread. (Otherwise,
we'd just inherit the mask of the thread manager.) */
sigprocmask(SIG_SETMASK, &self->p_start_args.mask, NULL);
/* Set the scheduling policy and priority for the new thread, if needed */
- if (self->p_start_args.schedpolicy >= 0)
- __sched_setscheduler(self->p_pid, self->p_start_args.schedpolicy,
+ if (THREAD_GETMEM(self, p_start_args.schedpolicy) >= 0)
+ __sched_setscheduler(THREAD_GETMEM(self, p_pid),
+ THREAD_GETMEM(self, p_start_args.schedpolicy),
&self->p_start_args.schedparam);
/* Make gdb aware of new thread */
if (__pthread_threads_debug) {
@@ -200,7 +202,8 @@ static int pthread_start_thread(void *arg)
suspend(self);
}
/* Run the thread code */
- outcome = self->p_start_args.start_routine(self->p_start_args.arg);
+ outcome = self->p_start_args.start_routine(THREAD_GETMEM(self,
+ p_start_args.arg));
/* Exit with the given return value */
pthread_exit(outcome);
return 0;
@@ -298,7 +301,7 @@ static int pthread_handle_create(pthread_t *thread, const pthread_attr_t *attr,
if (attr != NULL && attr->schedpolicy != SCHED_OTHER && geteuid () != 0)
return EPERM;
/* Find a free segment for the thread, and allocate a stack if needed */
- for (sseg = 1; ; sseg++)
+ for (sseg = 2; ; sseg++)
{
if (sseg >= PTHREAD_THREADS_MAX)
return EAGAIN;
@@ -340,6 +343,8 @@ static int pthread_handle_create(pthread_t *thread, const pthread_attr_t *attr,
new_thread->p_userstack = attr != NULL && attr->stackaddr_set;
memset (new_thread->p_specific, '\0',
PTHREAD_KEY_1STLEVEL_SIZE * sizeof (new_thread->p_specific[0]));
+ new_thread->p_self = new_thread;
+ new_thread->p_nr = sseg;
/* Initialize the thread handle */
__pthread_init_lock(&__pthread_handles[sseg].h_lock);
__pthread_handles[sseg].h_descr = new_thread;
@@ -370,8 +375,10 @@ static int pthread_handle_create(pthread_t *thread, const pthread_attr_t *attr,
/* Do the cloning */
pid = __clone(pthread_start_thread, (void **) new_thread,
CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND |
- __pthread_sig_restart,
- new_thread);
+#ifdef CLONE_PTRACE
+ CLONE_PTRACE |
+#endif
+ __pthread_sig_restart, new_thread);
/* Check if cloning succeeded */
if (pid == -1) {
/* Free the stack if we allocated it */
@@ -414,6 +421,9 @@ static void pthread_free(pthread_descr th)
handle->h_descr = NULL;
handle->h_bottom = (char *)(-1L);
__pthread_unlock(&handle->h_lock);
+#ifdef FREE_THREAD_SELF
+ FREE_THREAD_SELF(th, th->p_nr);
+#endif
/* One fewer threads in __pthread_handles */
__pthread_handles_num--;
/* If initial thread, nothing to free */
diff --git a/linuxthreads/pthread.c b/linuxthreads/pthread.c
index 313220e7a0..c7cfdac796 100644
--- a/linuxthreads/pthread.c
+++ b/linuxthreads/pthread.c
@@ -58,7 +58,13 @@ struct _pthread_descr_struct __pthread_initial_thread = {
NULL, /* char * p_in_sighandler */
0, /* char p_sigwaiting */
PTHREAD_START_ARGS_INITIALIZER, /* struct pthread_start_args p_start_args */
- {NULL} /* void * p_specific[PTHREAD_KEYS_MAX] */
+ {NULL}, /* void ** p_specific[PTHREAD_KEY_1STLEVEL_SIZE] */
+ {NULL}, /* void * p_libc_specific[_LIBC_TSD_KEY_N] */
+ 0, /* int p_userstack */
+ NULL, /* void * p_guardaddr */
+ 0, /* size_t p_guardsize */
+ &__pthread_initial_thread, /* pthread_descr p_self */
+ 0 /* Always index 0 */
};
/* Descriptor of the manager thread; none of this is used but the error
@@ -86,14 +92,20 @@ struct _pthread_descr_struct __pthread_manager_thread = {
0, /* char p_cancelstate */
0, /* char p_canceltype */
0, /* char p_canceled */
- NULL, /* int *p_errnop */
+ &__pthread_manager_thread.p_errno, /* int *p_errnop */
0, /* int p_errno */
NULL, /* int *p_h_errnop */
0, /* int p_h_errno */
NULL, /* char * p_in_sighandler */
0, /* char p_sigwaiting */
PTHREAD_START_ARGS_INITIALIZER, /* struct pthread_start_args p_start_args */
- {NULL} /* void * p_specific[PTHREAD_KEYS_MAX] */
+ {NULL}, /* void ** p_specific[PTHREAD_KEY_1STLEVEL_SI