Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8256314 JVM TI GetCurrentContendedMonitor is implemented incorrectly
  3. JDK-8326038

Release Note: The Meaning of Contended Monitor Has Been Clarified in JVM TI, JDWP, and JDI

XMLWordPrintable

      The JVMTI `GetCurrentContendedMonitor` implementation has been aligned with the spec. Thus, a monitor is returned only when the specified thread is waiting to enter or re-enter the monitor and the monitor is not returned when the specified thread is waiting in the `java.lang.Object.wait` to be notified.

      The JDWP `ThreadReference.CurrentContendedMonitor` command spec was updated to match the JVMTI `GetCurrentContendedMonitor` spec. It states now:
          "The thread may be waiting to enter the object's monitor, or in java.lang.Object.wait waiting to re-enter the monitor after being notified, interrupted, or timed-out."

      This part has been removed from the command description:
         "... it may be waiting, via the java.lang.Object.wait method, for another thread to invoke the notify method."

      The JDI `ThreadReference.currentContendedMonitor` method spec was updated to match the JVMTI `GetCurrentContendedMonitor` spec.
      It states now:
         "The thread can be waiting for a monitor through entry into a synchronized method, the synchronized statement, or Object.wait() waiting to re-enter the monitor after being notified, interrupted, or timed-out."

      This part has been added to the method description:
      "... or Object.wait() waiting to re-enter the monitor after being notified, interrupted, or timed-out."

      And this part has been removed from the method description:
        "The status() method can be used to differentiate between the first two cases and the third."

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

              Created:
              Updated:
              Resolved: