From: Ulrich Drepper Date: Tue, 21 Dec 1999 23:50:08 +0000 (+0000) Subject: (pthread_handle_create): Set p_pid of new thread before calling the callback X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=28fc1f68aa4f27b8c6b442999534d26498d30585;p=thirdparty%2Fglibc.git (pthread_handle_create): Set p_pid of new thread before calling the callback function to report a new thread. --- diff --git a/linuxthreads/manager.c b/linuxthreads/manager.c index 20966596938..8e9a3b5a42b 100644 --- a/linuxthreads/manager.c +++ b/linuxthreads/manager.c @@ -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 ();