Date: Mon, 28 Jun 2004 05:49:32 GMT From: Marcel Moolenaar <marcel@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 55982 for review Message-ID: <200406280549.i5S5nWMI036471@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=55982 Change 55982 by marcel@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));
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200406280549.i5S5nWMI036471>