Request for review (M): 7132070: Use a mach_port_t as the OSThread thread_id rather than pthread_t on BSD/OSX

Staffan Larsen staffan.larsen at oracle.com
Wed Feb 15 10:53:32 PST 2012


Unfortunately I can't verify if other bsd builds fail as we have none at our disposal.

/Staffan

On 15 feb 2012, at 14:57, Mikael Gerdin wrote:

> Hi Staffan,
> 
> It looks like you're adding Mac-specific stuff like thread_t and calls to ::mach_thread_self() inside _ALLBSD_SOURCE #ifdefs, are you sure this won't break BSD builds?
> Does the OSX compiler define _ALLBSD_SOURCE or is that for (free|net|open)bsd?
> It's too bad we don't do regular builds on any of the BSDs, otherwise this would have been easier to figure out.
> 
> /Mikael
> 
> 
> On 2012-02-15 11:29, Staffan Larsen wrote:
>> Please review the following change:
>> 
>> Bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7132070
>> 
>> Webrev: http://cr.openjdk.java.net/~sla/7132070/webrev.00/
>> 
>> This changes the value returned by OSThread::thread_id() and
>> os::current_thread_id() on macosx to return the mach thread_t instead of
>> pthread_t. There is a separate method OSThread:pthread_id() that returns
>> the pthread_t.
>> 
>> The reason for this change is both that JFR would like a 4 byte value
>> for thread id, and that SA requires access to the thread_t.
>> 
>> Thanks,
>> /Staffan
> 



More information about the serviceability-dev mailing list