PERFORCE change 55982 for review
Marcel Moolenaar
marcel at FreeBSD.org
Sun Jun 27 22:49:33 PDT 2004
http://perforce.freebsd.org/chv.cgi?CH=55982
Change 55982 by marcel at marcel_nfs on 2004/06/28 05:48:53
Give the initial thread uniqueid 1 and save the lwpid of the
process for consumption by thread_db.so.
Note that we probably want to support RELENG_4 when we're
ready with all this and have support contributed back to GDB.
For this we cannot change libc_r, so we need to find a way
(eventually) to make this work on 4.x. I'm not going to worry
about this now.
Affected files ...
.. //depot/projects/gdb/lib/libc_r/uthread/pthread_private.h#4 edit
.. //depot/projects/gdb/lib/libc_r/uthread/uthread_init.c#2 edit
Differences ...
==== //depot/projects/gdb/lib/libc_r/uthread/pthread_private.h#4 (text+ko) ====
@@ -1189,6 +1189,12 @@
#endif
;
+SCLASS int _libc_r_lwpid
+#ifdef GLOBAL_PTHREAD_PRIVATE
+= 0
+#endif
+;
+
/* Undefine the storage class specifier: */
#undef SCLASS
==== //depot/projects/gdb/lib/libc_r/uthread/uthread_init.c#2 (text+ko) ====
@@ -337,6 +337,7 @@
memset(&_thread_kern_thread, 0, sizeof(struct pthread));
_thread_kern_thread.flags = PTHREAD_FLAGS_PRIVATE;
memset(_thread_initial, 0, sizeof(struct pthread));
+ _thread_initial->uniqueid = 1;
/* Initialize the waiting and work queues: */
TAILQ_INIT(&_waitingq);
@@ -345,6 +346,9 @@
/* Initialize the scheduling switch hook routine: */
_sched_switch_hook = NULL;
+ /* Save the lwpid of the one LWP this process has. */
+ _libc_r_lwpid = getlwpid();
+
/* Give this thread default attributes: */
memcpy((void *) &_thread_initial->attr, &_pthread_attr_default,
sizeof(struct pthread_attr));
More information about the p4-projects
mailing list