PERFORCE change 55978 for review

Marcel Moolenaar marcel at FreeBSD.org
Sun Jun 27 22:26:03 PDT 2004


http://perforce.freebsd.org/chv.cgi?CH=55978

Change 55978 by marcel at marcel_nfs on 2004/06/28 05:25:04

	Change next_uniqueid to last_uniqueid and use a pre-inc
	instead of a post-inc. The net effect is that ids start
	with 2 instead of one, leaving 1 for use by the initial
	thread. Previously the initial thread had id 0, but that's
	a particularly bad id to use for GDB.

Affected files ...

.. //depot/projects/gdb/lib/libc_r/uthread/uthread_create.c#2 edit

Differences ...

==== //depot/projects/gdb/lib/libc_r/uthread/uthread_create.c#2 (text+ko) ====

@@ -46,7 +46,7 @@
 #include "pthread_private.h"
 #include "libc_private.h"
 
-static u_int64_t next_uniqueid = 1;
+static u_int64_t last_uniqueid = 1;
 
 #define OFF(f)	offsetof(struct pthread, f)
 int _thread_next_offset			= OFF(tle.tqe_next);
@@ -212,7 +212,7 @@
 			 * Initialise the unique id which GDB uses to
 			 * track threads.
 			 */
-			new_thread->uniqueid = next_uniqueid++;
+			new_thread->uniqueid = ++last_uniqueid;
 
 			/*
 			 * Check if the garbage collector thread


More information about the p4-projects mailing list