On Thu, 30 Nov 2023 20:58:41 GMT, Serguei Spitsyn <sspit...@openjdk.org> wrote:
> It is a little bit ugly to do it for each call site. > The Handshake::execute() can do it instead, so its call sites could be > simplified. > BTW, it is done in the JvmtiHandshake::execute() and one can find it to be > convenient. Agreed, but it is intentional that direct uses of the three parameter version of `Handshake::execute()` with `tlh == nullptr` require that the caller understands the calling context. That means knowing where your ThreadsListHandle is and not getting away with not having one when the caller is current thread. Higher layer callers of `Handshake::execute()` like `JvmtiHandshake::execute()` or `JvmtiEventControllerPrivate::enter_interp_only_mode()` can make that less strict choice if they choose to. ------------- PR Comment: https://git.openjdk.org/jdk/pull/16686#issuecomment-1834675329