RFR: 8346792: serviceability/jvmti/vthread/GetThreadState/GetThreadState.java testObjectWaitMillis failed

Serguei Spitsyn sspitsyn at openjdk.org
Thu Jan 16 06:14:39 UTC 2025


On Wed, 15 Jan 2025 22:45:54 GMT, Serguei Spitsyn <sspitsyn at openjdk.org> wrote:

> Another thing I noticed for the ObjectLocker::wait_uninterruptibly() case is that we don’t post the monitor_wait event but we do post the monitor_waited one.

The monitor_wait event is posted in the `jvm.cpp` `JVM_MonitorWait()` function:

JVM_ENTRY(void, JVM_MonitorWait(JNIEnv* env, jobject handle, jlong ms))
  Handle obj(THREAD, JNIHandles::resolve_non_null(handle));
  if (JvmtiExport::should_post_monitor_wait()) {
    JvmtiExport::post_monitor_wait(thread, obj(), ms);

    // The current thread already owns the monitor and it has not yet
    // been added to the wait queue so the current thread cannot be
    // made the successor. This means that the JVMTI_EVENT_MONITOR_WAIT
    // event handler cannot accidentally consume an unpark() meant for
    // the ParkEvent associated with this ObjectMonitor.
  }
  ObjectSynchronizer::wait(obj, ms, CHECK);
JVM_END

-------------

PR Comment: https://git.openjdk.org/jdk/pull/23126#issuecomment-2594615485


More information about the hotspot-runtime-dev mailing list