From owner-svn-src-head@FreeBSD.ORG Mon Nov 3 17:36:45 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F214106567B; Mon, 3 Nov 2008 17:36:45 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from cmail.optima.ua (cmail.optima.ua [195.248.191.121]) by mx1.freebsd.org (Postfix) with ESMTP id E3B878FC1D; Mon, 3 Nov 2008 17:36:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) X-Spam-Flag: SKIP X-Spam-Yversion: Spamooborona-2.1.0 Received: from [212.86.226.226] (account mav@alkar.net HELO mavbook.mavhome.dp.ua) by cmail.optima.ua (CommuniGate Pro SMTP 5.2.9) with ESMTPSA id 226881598; Mon, 03 Nov 2008 19:36:43 +0200 Message-ID: <490F36A8.70601@FreeBSD.org> Date: Mon, 03 Nov 2008 19:36:40 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.17 (X11/20081029) MIME-Version: 1.0 To: Jung-uk Kim References: <200811021250.mA2CoGs1038957@svn.freebsd.org> <200811031050.48765.jkim@FreeBSD.org> <490F21FC.1020508@FreeBSD.org> <200811031226.46956.jkim@FreeBSD.org> In-Reply-To: <200811031226.46956.jkim@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r184558 - head/sys/dev/acpica/Osd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 17:36:45 -0000 Jung-uk Kim wrote: >> I'm also sorry, but that is what I see: >> typedef __int32_t __lwpid_t; /* Thread ID (a.k.a. LWP) >> */ ... >> td->td_tid = alloc_unr(tid_unrhdr); >> ... >> tid_unrhdr = new_unrhdr(PID_MAX + 2, INT_MAX, &tid_lock); >> >> So what have I missed, where is the problem? Why td_tid is not >> unique and where is the size problem? > > On top of that: > > /* Returning 0 is not allowed. */ > return (curthread->td_tid + 1); > > may actually return 0 because it can be INT_MAX. :-) No, maximum is positive overflow. :) Actually "+ 1" is probably not needed here as system assigns thread IDs are above process IDs and ID 0 is already busy. :) PS: More arguments sent privately. -- Alexander Motin