On Mon, 13 May 2024 18:32:45 GMT, Chris Plummer <[email protected]> wrote:

>> FWIW Deleting monitors is a tricky business and needs to be done with great 
>> care. You have to ensure all threads using the monitor are completely done 
>> with it. Simply locking it first to check it is "unused" is not sufficient.
>
> This is probably the reason that the debug agent only destroys one of the 20 
> or so monitors it creates. I'm not sure how it got to that point. It may have 
> destroyed more at one point but there were issues, and only one survived 
> destruction without issue.

If debugger attaches to the debuggee, detaches and re-attaches again, are the 
monitors recreated again?
(with rankedMonitor you added an assert if `DebugRawMonitor::monitor` is not 
null)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19044#discussion_r1599125113

Reply via email to