On Tue, 5 Mar 2024 07:07:27 GMT, David Holmes <dhol...@openjdk.org> wrote:
> I have to say that I don't understand how the behaviour of `RawMonitorWait` > is any different to `ObjectMonitor::wait` when it comes to the use of the > is_interrupted(true). ??? Is it simply that because we are in native code and > we can immediately query the actual thread state that we can observe when the > carrier and virtual thread states are transiently different? The behavior of `ObjectMonitor::wait` and `RawMonitorWait` is different. The `Object.wait()` throws the `InterruptedException` if it was interrupted. The `RawMonitorWait` clears the thread `interrupt status` and returns the error code `JVMTI_ERROR_INTERRUPT`. Also, I guess, Alan partially answered this question here: > For `Object.wait`, the clearing of the interrupt status is done in the Java > code, something that will change once `Object.wait` changes to > `freeze/unmount` when not pinned. ------------- PR Comment: https://git.openjdk.org/jdk/pull/18093#issuecomment-1979528696