Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 03 Nov 2008 19:36:40 +0200
From:      Alexander Motin <mav@FreeBSD.org>
To:        Jung-uk Kim <jkim@FreeBSD.org>
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
Message-ID:  <490F36A8.70601@FreeBSD.org>
In-Reply-To: <200811031226.46956.jkim@FreeBSD.org>
References:  <200811021250.mA2CoGs1038957@svn.freebsd.org> <200811031050.48765.jkim@FreeBSD.org> <490F21FC.1020508@FreeBSD.org> <200811031226.46956.jkim@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



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