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

Trace event for thread park has incorrect unit for timeout

XMLWordPrintable

    • jfr
    • b24

        In trace.xml the ThreadPark event has the following timeout definition:
        <value type="MILLIS" field="timeout" label="Park Timeout"/>
        and the trace code copies the "time" jlong passed to Unsafe::park right into the timeout field in the event.

        The problem is that the specification for Unsafe::park is a bit more complex than that.
        * If the "isAbsolute" jboolean is true then the interpretation of the "time" parameter should be a "milliseconds since epoch" timestamp.
        * If "isAbsolute" is false then the interpretation of the "time" parameter should be a timeout in nanoseconds relative to "now".

        The first case appears to require the EPOCHMILLIS type whereas the second case requires the NANOS type so the current implementation is incorrect for any value of "isAbsolute"

              egahlin Erik Gahlin
              mgerdin Mikael Gerdin (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved: