]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(pthread_handle_create): Set p_pid of new thread before calling the callback
authorUlrich Drepper <drepper@redhat.com>
Tue, 21 Dec 1999 23:50:08 +0000 (23:50 +0000)
committerUlrich Drepper <drepper@redhat.com>
Tue, 21 Dec 1999 23:50:08 +0000 (23:50 +0000)
function to report a new thread.

linuxthreads/manager.c

index 2096659693859c4c43ef4e88265ce848ad5da4ce..8e9a3b5a42b89e5768253dcc3313c90a801b7f3a 100644 (file)
@@ -448,6 +448,11 @@ static int pthread_handle_create(pthread_t *thread, const pthread_attr_t *attr,
              new_thread->p_eventbuf.eventnum = TD_CREATE;
              __pthread_last_event = new_thread;
 
+             /* We have to set the PID here since the callback function
+                in the debug library will need it and we cannot guarantee
+                the child got scheduled before the debugger.  */
+             new_thread->p_pid = pid;
+
              /* Now call the function which signals the event.  */
              __linuxthreads_create_event ();