Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7132070

Use a mach_port_t as the OSThread thread_id rather than pthread_t on BSD/OSX

XMLWordPrintable

    • b01
    • generic
    • os_x
    • Verified

        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());

              sla Staffan Larsen (Inactive)
              phh Paul Hohensee
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: