On Wed, 13 Jul 2022 18:46:07 GMT, Chris Plummer <cjplum...@openjdk.org> wrote:
> `Actually I'm going to amend my previous comment about concerns with > synchronization of the test. I think once the SetEventNotificationMode() call > returns (after passing JVMTI_DISABLE), the caller should be guaranteed that > any call to the event handler that was in progress has completed. So the > caller should be able to safely free the raw monitor that is used in the > callback. I'm not sure if JVMTI makes this guarantee however.` The following RN is related to this question: https://bugs.openjdk.org/browse/JDK-8256558 It explicitly says: `SetNotificationMode can be used to explicitly flush ObjectFree events, if needed.` This RN is related to the bug pointed out by @zhengyu123 above: [JDK-8212879](https://bugs.openjdk.org/browse/JDK-8212879) However, I feel that we still need to test it heavily to make sure there are no surprises. ------------- PR: https://git.openjdk.org/jdk/pull/9168