]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(__pthread_manager_event): New function.
authorUlrich Drepper <drepper@redhat.com>
Mon, 22 Nov 1999 20:38:21 +0000 (20:38 +0000)
committerUlrich Drepper <drepper@redhat.com>
Mon, 22 Nov 1999 20:38:21 +0000 (20:38 +0000)
(pthread_start_thread_event): Fix computation of self.  Use INIT_THREAD_SELF.

linuxthreads/manager.c

index 4d8bedd45b8a97482865f7a963a4b10a126d2567..94b78a474e824553f7ec05c150c698c2405f6608 100644 (file)
@@ -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.  */