RFR: 8352178: Add precondition in Handshake::execute to prevent deadlock [v2]

Patricio Chilano Mateo pchilanomate at openjdk.org
Tue Mar 18 13:41:11 UTC 2025


On Tue, 18 Mar 2025 08:48:21 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

>> Simple patch of adding `SuspendibleThreadSet` related precondition to `Handshake::execute` in order to prevent deadlock.
>> All existing callsites satisfy this precondition already.
>> 
>> Test: tier1-5
>
> Albert Mingkun Yang has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Update src/hotspot/share/runtime/handshake.cpp
>   
>   Co-authored-by: David Holmes <62092539+dholmes-ora at users.noreply.github.com>

src/hotspot/share/runtime/handshake.cpp line 359:

> 357:   // deadlock.
> 358:   assert(!current_thread->is_suspendible_thread(), "precondition");
> 359:   assert(!current_thread->is_indirectly_suspendible_thread(), "precondition");

Why not move the asserts to VMThread::execute() to cover any operation, not just VM_HandshakeAllThreads?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24088#discussion_r2001072591


More information about the hotspot-runtime-dev mailing list