The JDWP ObjectReference.MonitorInfo command spec has a typo needs a clarification for the `waiters` field.
This is the input from [~dholmes] below:
>>>
I think a clarification to the JDWP spec is in order as it simply states:
`waiters` The number of threads that are waiting for the monitor 0 if there is no current owner
with no explanation of exactly what "waiting for the monitor" means. That said there is a problem with the interpretation that it means "waiting to enter, or waiting to be notified" as that conflicts with the statement "0 if there is no current owner" because we can have no current owner but still have multiple threads waiting to be notified. But that said I think any mention of "current owner" here is a mistake and not relevant to what "waiters" is actually trying to report: it will be zero if there are no waiters, regardless of whether there is currently an owner or not. So this part of the JDWP spec needs fixing too. Separate issue is fine for that of course.
<<<
Also, there is a typo in the description above. At least it has to be specified as:
"The number of threads that are waiting for the monitor, or 0 if there is no current owner."
Please, see: https://docs.oracle.com/en/java/javase/21/docs/specs/jdwp/jdwp-protocol.html#JDWP_ObjectReference_MonitorInfo
This is the input from [~dholmes] below:
>>>
I think a clarification to the JDWP spec is in order as it simply states:
`waiters` The number of threads that are waiting for the monitor 0 if there is no current owner
with no explanation of exactly what "waiting for the monitor" means. That said there is a problem with the interpretation that it means "waiting to enter, or waiting to be notified" as that conflicts with the statement "0 if there is no current owner" because we can have no current owner but still have multiple threads waiting to be notified. But that said I think any mention of "current owner" here is a mistake and not relevant to what "waiters" is actually trying to report: it will be zero if there are no waiters, regardless of whether there is currently an owner or not. So this part of the JDWP spec needs fixing too. Separate issue is fine for that of course.
<<<
Also, there is a typo in the description above. At least it has to be specified as:
"The number of threads that are waiting for the monitor, or 0 if there is no current owner."
Please, see: https://docs.oracle.com/en/java/javase/21/docs/specs/jdwp/jdwp-protocol.html#JDWP_ObjectReference_MonitorInfo
- duplicates
-
JDK-8247972 incorrect implementation of JVM TI GetObjectMonitorUsage
- Resolved
- relates to
-
JDK-8247972 incorrect implementation of JVM TI GetObjectMonitorUsage
- Resolved