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

GetCurrentThreadCpuTime and GetThreadCpuTime need further clarification for virtual threads

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • P3
    • Resolution: Fixed
    • 21
    • 21
    • hotspot
    • b18

    Description

      This is a follow-up to JDK-8302615 where GetCurrentThreadCpuTime and GetThreadCpuTime were changed from being not supported to optional, when called from/with a virtual thread. There are two additional sentences that need adjustment to avoid creating a conflict in the spec.

      --- a/src/hotspot/share/prims/jvmti.xml
      +++ b/src/hotspot/share/prims/jvmti.xml
      @@ -11022,7 +11022,8 @@ myInit() {
                   the current thread (see
                   <functionlink id="GetCurrentThreadCpuTimerInfo"/> vs
                   <functionlink id="GetThreadCpuTimerInfo"/>).
      - The current thread may not be a virtual thread. Otherwise, the error code
      + An implementation is not required to support this function
      + when the current thread is a virtual thread, in which case
                   <errorlink id="JVMTI_ERROR_UNSUPPORTED_OPERATION"></errorlink> will be returned.
                   On many platforms this call will be equivalent to:
       <example>
      @@ -11125,7 +11126,8 @@ myInit() {
                 <jthread null="current" impl="noconvert"/>
                   <description>
                     The thread to query.
      - The <code>thread</code> may not be a virtual thread. Otherwise, the error code
      + An implementation is not required to support this function
      + when the given thread is a virtual thread, in which case
                      <errorlink id="JVMTI_ERROR_UNSUPPORTED_OPERATION"></errorlink> will be returned.
                    </description>
               </param>

      Attachments

        Issue Links

          Activity

            People

              sspitsyn Serguei Spitsyn
              alanb Alan Bateman
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: