On Thu, 21 Jul 2022 04:11:05 GMT, Chris Plummer <cjplum...@openjdk.org> wrote:
> > 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.` > > That wasn't quite what I was getting at. My comment / question was much more > general. If you call SetEventNotificationMode() to disable a specific event, > once it returns are you guaranteed that no more events will be delivered. > This means that if JVMTI was in the middle of calling the event handler at > the same time that SetEventNotificationMode() is called, then before > returning, SetEventNotificationMode() will block until the event handler > returns. There is no such general guarantee with calls to the `SetEventNotificationMode`. It is not in the `JVM TI` spec. My view of the `JVM TI `design is that it is up to the native agents to provide synchronization if needed. For instance, I spent some time in the past to fix several problems related to the `JDWP` agent shutdown as the `WRONG_PHASE` error code was appearing in the middle of an event handler execution. ------------- PR: https://git.openjdk.org/jdk/pull/9168