Date: Fri, 7 May 1999 13:10:47 -0700 (PDT) From: Matthew Dillon <dillon@apollo.backplane.com> To: Doug Rabson <dfr@nlsystems.com> Cc: current@FreeBSD.ORG Subject: Re: Debugging FreeBSD user threads with gdb Message-ID: <199905072010.NAA46817@apollo.backplane.com> References: <Pine.BSF.4.05.9905072102080.10400-100000@herring.nlsystems.com>
next in thread | previous in thread | raw e-mail | index | archive | help
:--- uthread_create.c 1999/03/23 05:07:55 1.12 :+++ uthread_create.c 1999/05/06 15:27:33 :@@ -42,6 +42,8 @@ : #include "pthread_private.h" : #include "libc_private.h" : :+static int next_tid = 1; :+ : int : pthread_create(pthread_t * thread, const pthread_attr_t * attr, : void *(*start_routine) (void *), void *arg) :@@ -87,6 +89,7 @@ : } else { : /* Initialise the thread structure: */ : memset(new_thread, 0, sizeof(struct pthread)); :+ new_thread->tid = next_tid++; : :Doug Rabson Mail: dfr@nlsystems.com :Nonlinear Systems Ltd. Phone: +44 181 442 9037 Hmmm. tid is only an int and some programs which create and destroy threads a lot are almost certainly going to overflow it. 4 billion is not hard to reach. This can result in duplicate tid's. -Matt Matthew Dillon <dillon@backplane.com> To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199905072010.NAA46817>