On Mon, 13 Jun 2022 07:45:41 GMT, Robbin Ehn <r...@openjdk.org> wrote:
>> Johan Sjölén has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Move assert up and remove other assert, remove unused var > > The only way to become an active handshaker is to handshake another thread > (target), when that happens we verify that target is ThreadsList safe. > Thus active handshaker is guaranteed that the target is already verified on a > ThreadsList. > As long as we are the active handshake the target is blocked, i.e. target is > safepoint safe. > > The reason I think handshake safe is good is because we have 3 (4) cases: > 1: Current != Target (Not 3 and not 4) > 2: Current == Target > 3: Current != Target, but already executing a handshake for target > 4: Current != Target, but we are in a safepoint (still no internally handled) @robehn can you explain to me how the current thread can both be the active handshaker of the target _and_ at the same time be executing another handshake with the target? This is making my head spin. This change has deviated quite considerably from the issue that caused a bug to be filed. And Dan still has concerns that the current thread should still be protected by a TLH even if not strictly necessary. Maybe we actually need to backtrack and restore an invariant that there is always a TLH even for the current thread and fix the JVMTI code that did things differently? ------------- PR: https://git.openjdk.org/jdk/pull/8992