On Wed, 28 Jan 2026 12:37:55 GMT, Anton Artemov <[email protected]> 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

Reply via email to