On Tue, 26 Sep 2023 01:09:47 GMT, David Holmes <dhol...@openjdk.org> wrote:

>> Surely jstack thread dump and deadlock check _has_ to run at a safepoint?
>
> Also isn't "anonymous locking" an intermediate step in monitor inflation? The 
> inflated monitor becomes anonymously owned until the real owner sees it has 
> been inflated and updates the ownership accordingly.

To expand if deadlock detection does not run at a safepoint then this logic is 
non-atomic and completely broken:

 threads = VM.getVM().getThreads();
 heap = VM.getVM().getObjectHeap();
 createThreadTable();  // calls getThreads() again

Without a stable VM you could have three almost completely different set of 
threads when each of these statements run!

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15907#discussion_r1336523076

Reply via email to