JDK-7132070 : Use a mach_port_t as the OSThread thread_id rather than pthread_t on BSD/OSX
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: hs23
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: os_x
  • CPU: generic
  • Submitted: 2012-01-20
  • Updated: 2013-08-09
  • Resolved: 2012-02-27
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 JDK 8 Other
7u40Fixed 8Fixed hs23.2Fixed
Related Reports
Relates :  
Description
On OSX, a pthread_t is used as the native thread id in an OSThread.  pthread_t
is a 8-byte value rather a 4-byte value as it is on the other supported platforms.
Java Flight Recorder currently relies on the thread id being 4 rather than 8 bytes,
and it would require a file format change to switch.  The thread id is an identifier
and doesn't appear to be used for anything else on OSX.

Rather than change file formats, it might be possible to instead use a mach_port_t,
which is an unsigned int (and thus 4 bytes).  To get it, use

mach_port_t tid = pthread_mach_thread_np(pthread_self());

Comments
EVALUATION http://hg.openjdk.java.net/hsx/hsx23.2/hotspot/rev/adaa2f10c81b
08-05-2012

EVALUATION http://hg.openjdk.java.net/lambda/lambda/hotspot/rev/0368109684cb
22-03-2012

EVALUATION http://hg.openjdk.java.net/hsx/hotspot-main/hotspot/rev/0368109684cb
22-02-2012

EVALUATION http://hg.openjdk.java.net/hsx/hotspot-rt/hotspot/rev/0368109684cb
20-02-2012