On Mon, 28 Oct 2024 18:58:29 GMT, Patricio Chilano Mateo 
<pchilanom...@openjdk.org> wrote:

> regardless of when you freeze, while doing the freezing the monitor could 
> have been released already. So trying to acquire the monitor after freezing 
> can always succeed, which means we don't want to unmount but continue 
> execution, i.e cancel the preemption.

Is this purely a performance optimization, or is there a correctness issue if 
we don't notice the monitor was released and cancel the preemption?  It seems 
like the monitor can be released at any time, so what makes freeze special that 
we need to check afterwards?  We aren't doing the monitor check atomically, so 
the monitor could get released right after we check it.  So I'm guessing we 
choose to check after freeze because freeze has non-trivial overhead.

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

PR Comment: https://git.openjdk.org/jdk/pull/21565#issuecomment-2442880740

Reply via email to