RFR: 8366659: ObjectMonitor::wait() liveness problem with a suspension request [v31]

Serguei Spitsyn sspitsyn at openjdk.org
Wed Jan 28 16:03:41 UTC 2026


On Wed, 28 Jan 2026 12:37:55 GMT, Anton Artemov <aartemov at openjdk.org> wrote:

>> The `ThreadBlockInVM` is there so that a thread suspended before being notified does not expose that fact by issuing a monitor_waited event whilst suspended.
>
> Moving `ThreadBlockInVM` outside will make it possible to suspend the successor thread, which we don't want to happen. Getting rid of it completely will make it possible, as David said, to post the waited event while being suspended, which we also do not want to happen.

Okay. Then what about this ? :

   if (interruptible && node.TState != ObjectWaiter::TS_ENTER) {   
     // Process suspend requests now if any, before posting the event
     {
       ThreadBlockInVM tbvm(current, true);
     }
     if (JvmtiExport::should_post_monitor_waited()) {
      JvmtiExport::post_monitor_waited(current, this, ret == OS_TIMEOUT);
     }

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2737343109


More information about the serviceability-dev mailing list