Current implementation of JVMTI SetExtensionEventCallback() registers the 
callback but does not enable the event. This behavior matches normal events, so 
there is a symmetry between normal and extension events.

However, the SetExtensionEventCallback spec states this:

Sets the callback function for an extension event and enables the event. Or, if 
the callback is NULL, disables the event. Note that unlike standard events, 
setting the callback and enabling the event are a single operation.

This wording about enabling/disabling the events has to be removed from 
SetExtensionEventCallback spec.
It seems that extension events are not used by the JVMTI agents. Two extension 
events are used in number of tests:
 - `VirtualThreadMount` and `VirtualThreadUnmount`

Testing: N/A

---------
- [x] I confirm that I make this contribution in accordance with the [OpenJDK 
Interim AI Policy](https://openjdk.org/legal/ai).

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

Commit messages:
 - 8394716: SetExtensionEventCallback should not enable the event

Changes: https://git.openjdk.org/jdk/pull/33415/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=33415&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8394716
  Stats: 8 lines in 1 file changed: 1 ins; 1 del; 6 mod
  Patch: https://git.openjdk.org/jdk/pull/33415.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/33415/head:pull/33415

PR: https://git.openjdk.org/jdk/pull/33415

Reply via email to