> Please review the following fix. When blocking in > `ObjectMonitor::enter_internal` we currently use timed-park for pinned > virtual threads. This is done to alleviate some potential deadlocks cases > where the successor is an unmounted virtual thread that cannot run. In > particular this could happen during class loading/initialization if all other > carriers are blocked waiting for the same class to be loaded/initialized. > This mechanism should be extended to cover `ObjectMonitor::reenter_internal` > used in `Object.wait` (notification case). Also, the criteria to decide > whether to do a timed-park should be based on whether there are unmounted > vthreads already in the `_entry_list`, and not just if this is a pinned > virtual thread. This covers mixed usages of the same ObjectMonitor between > virtual threads and platform threads. This will become more relevant once we > bring the changes currently in the fibers branch to preempt virtual threads > during klass initialization. > > These changes have been running in the loom pipeline for a couple of months > already. I also added a new test case to > test/jdk/java/lang/Thread/virtual/MonitorWaitNotify.java which deadlocks > without these changes. > > Thanks, > Patricio
Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision: Add string in asserts ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27597/files - new: https://git.openjdk.org/jdk/pull/27597/files/bf3613e1..9e435e09 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27597&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27597&range=03-04 Stats: 3 lines in 1 file changed: 0 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/27597.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27597/head:pull/27597 PR: https://git.openjdk.org/jdk/pull/27597
