Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Jun 2004 05:26:02 GMT
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 55978 for review
Message-ID:  <200406280526.i5S5Q2uK035803@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=55978

Change 55978 by marcel@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200406280526.i5S5Q2uK035803>