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
Wed Feb 15 10:52:19 PST 2012

On 15 feb 2012, at 12:52, David Holmes wrote:

> Hi Staffan,
> Not directly related to the change but what does  _ALLBSD_SOURCE signify?

What Dan said (I wasn't sure myself).

> In os_bsd.cpp:
> In os::thread_cpu_time the type of mach_thread has changed from mach_port_t to thread_t, but mach_thread is still passed into thread_info(). I expect they are both simple integral types, but I would expect that later gcc compilers might complain about this. What type does thread_info expect?

thread_info() expects a thread_t, but thread_t and mach_port_t are actually the same thing (typdef:ed).

> Otherwise seems ok.


> David
> On 15/02/2012 8:29 PM, Staffan Larsen wrote:
>> Please review the following change:
>> Bug:
>> Webrev:
>> 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 hotspot-runtime-dev mailing list