aboutsummaryrefslogtreecommitdiff
path: root/linuxthreads/manager.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-11-22 20:53:18 +0000
committerUlrich Drepper <drepper@redhat.com>1999-11-22 20:53:18 +0000
commit20bdb31bfc27e044290756a681e3329f6e677ab7 (patch)
tree83fcba351926c80cad192dfb56ee8e42ac3535d3 /linuxthreads/manager.c
parentba90ec1141c97aa17bfe701f0f9def3f7544895f (diff)
downloadglibc-20bdb31bfc27e044290756a681e3329f6e677ab7.tar
glibc-20bdb31bfc27e044290756a681e3329f6e677ab7.tar.gz
glibc-20bdb31bfc27e044290756a681e3329f6e677ab7.tar.bz2
glibc-20bdb31bfc27e044290756a681e3329f6e677ab7.zip
Update.
1999-11-22 Ulrich Drepper <drepper@cygnus.com> * internals.h: Add prototype for __pthread_manager_event. * manager.c (__pthread_manager_event): New function. (pthread_start_thread_event): Correct computation of self. Use INIT_THREAD_SELF. * pthread.c (__pthread_manager_thread): Initialize p_lock. (__pthread_initialize_manager): Respect event flags also for creation of the manager thread.
Diffstat (limited to 'linuxthreads/manager.c')
-rw-r--r--linuxthreads/manager.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/linuxthreads/manager.c b/linuxthreads/manager.c
index 21a3f6875f..0168b8a11c 100644
--- a/linuxthreads/manager.c
+++ b/linuxthreads/manager.c
@@ -182,6 +182,21 @@ int __pthread_manager(void *arg)
}
}
+int __pthread_manager_event(void *arg)
+{
+ /* If we have special thread_self processing, initialize it. */
+#ifdef INIT_THREAD_SELF
+ INIT_THREAD_SELF(&__pthread_manager_thread, 1);
+#endif
+
+ /* Get the lock the manager will free once all is correctly set up. */
+ __pthread_lock (THREAD_GETMEM((&__pthread_manager_thread), p_lock), NULL);
+ /* Free it immediately. */
+ __pthread_unlock (THREAD_GETMEM((&__pthread_manager_thread), p_lock));
+
+ return __pthread_manager(arg);
+}
+
/* Process creation */
static int pthread_start_thread(void *arg)
@@ -232,8 +247,11 @@ static int pthread_start_thread(void *arg)
static int pthread_start_thread_event(void *arg)
{
- pthread_descr self = thread_self ();
+ pthread_descr self = (pthread_descr) arg;
+#ifdef INIT_THREAD_SELF
+ INIT_THREAD_SELF(self, self->p_nr);
+#endif
/* Get the lock the manager will free once all is correctly set up. */
__pthread_lock (THREAD_GETMEM(self, p_lock), NULL);
/* Free it immediately. */