Please review this small fix.

`SetExtensionEventCallback()` registers the callback but does not enable the 
event.

**Fix:**

Update the user-enabled bit when setting or clearing the callback, and add 
mount/unmount protection when updating the event state.

**Testing:**

- Removed explicit mount/unmount enabling from `libVThreadEventTest.cpp` to 
verify that callback registration enables the events.
- In `libMethodExitTest.cpp`, disable these events after registration, since 
the test enables them per thread at the second breakpoint.
- `serviceability/jvmti`: 264 passed, 0 failed.
- `vmTestbase/nsk/jvmti`: 586 passed, 0 failed.



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

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

Commit messages:
 - 8330166: SetExtensionEventCallback does not enable the event, contradicting 
documentation

Changes: https://git.openjdk.org/jdk/pull/33295/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=33295&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8330166
  Stats: 18 lines in 5 files changed: 9 ins; 6 del; 3 mod
  Patch: https://git.openjdk.org/jdk/pull/33295.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/33295/head:pull/33295

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

Reply via email to