On Thu, 30 Nov 2023 17:33:28 GMT, Daniel D. Daugherty <dcu...@openjdk.org> 
wrote:

> I don't think we should change the guarantee() in Handshake::execute(). When 
> the
> three parameter version of execute() is called with tlh == nullptr, the 
> caller is
> saying that there is supposed to be a ThreadsListHandle in the calling 
> context. Yes,
> if the target thread is the calling thread, then a ThreadsListHandle is not 
> needed,
> but that's why we have this code to prevent the call to Handshake::execute(): 
>       if (target->is_handshake_safe_for(current)) {
>         hs.do_thread(target);
> 
> In other words, I think Handshake::execute() is working the way it is 
> supposed to
> when tlh == nullptr is passed.

Just to share my view...
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.

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

PR Comment: https://git.openjdk.org/jdk/pull/16686#issuecomment-1834550955

Reply via email to