> A jdk.VirtualPinnedEvent JFR event is recorded by Object::wait when a virtual 
> thread waits in Object.wait while pinned. The posting of the event in 
> ObjectMonitor::wait is done after waiting but it can block again in 
> enter/ReenterI before it re-acquires. If that happens then the event duration 
> won't be accurate, and for the off-list case, the enter may be contended and 
> a jdk.VirtualPinnedEvent event will be recorded for contended monitor enter. 
> The changes to fix this are small: move the post of the event for Object.wait 
> to end of the wait function, and only post an event for contended monitor 
> enter when not waiting.
> 
> I've added a test to check the pinned event that is recored for several 
> contended monitor enter and Object.wait cases. It checks the event duration 
> and that only one event is recorded for each case.

Alan Bateman has updated the pull request with a new target base due to a merge 
or a rebase. The incremental webrev excludes the unrelated changes brought in 
by the merge/rebase. The pull request contains nine additional commits since 
the last revision:

 - Remove redundant asserts
 - Merge branch 'master' into JDK-8346120
 - Merge branch 'master' into JDK-8346120
 - Fix test comments
 - testObjectWait2 test already owns lock
 - Min duration check needs to have some tolerance
 - Rename test, check more event fields
 - Filter out VirtualThread.getAndClearInterrupt
 - Initial commit

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/22718/files
  - new: https://git.openjdk.org/jdk/pull/22718/files/51ef032d..bb2217c1

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=22718&range=03
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22718&range=02-03

  Stats: 1426 lines in 104 files changed: 651 ins; 253 del; 522 mod
  Patch: https://git.openjdk.org/jdk/pull/22718.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/22718/head:pull/22718

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

Reply via email to