Please review following test fix that improve synchronization of compiled 
method load/unload events.

The CompiledMethodLoad/CompiledMethodUnload might be already executing while 
SetEventCallbacks removed their callbacks.
Thus they hit 'newEventCount' after setting it to zero and cause test to fail.

The simple monitor inside event doesn't help, because race might happen while 
callback is calling in VM or before it obtain lock.

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

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

Commit messages:
 - shorter comment
 - fixed 8373645

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

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

Reply via email to