On Thu, 27 Mar 2025 22:13:17 GMT, Larry Cable <d...@openjdk.org> wrote:

>> src/jdk.attach/macosx/native/libattach/VirtualMachineImpl.c line 157:
>> 
>>> 155:             snprintf(msg, sizeof(msg), "pid: %d, state is not ready to 
>>> participate in attach handshake!", (int)pid);
>>> 156: 
>>> 157:             JNU_ThrowByName(env, 
>>> "com/sun/tools/attach/AttachNotSupportedException", msg);
>> 
>> I am not too familiar with JNI. Would it be cleaner/beneficial if this 
>> native method just returned `JNI_TRUE`/`JNI_FALSE` to indicate whether or 
>> not the `SIGQUIT` was sent and then in the Java code side, handle the 
>> `throwIfNotReady` part and create and throw the exception if this function 
>> returned `JNI_FALSE` and `throwIfNotReady` was `true`?
>> Would there be any benefit of doing that in the Java side instead of here?
>
> it would be different not necessarily better and this is the same pattern as 
> is used for the pre-existing Linux imp

I see. Thank you Larry.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24085#discussion_r2018259411

Reply via email to