Hi, please consider the following changes:

this is a fix for a bug in the `ObjectMonitor::wait()` method introduced by 
[8366659](https://bugs.openjdk.org/browse/JDK-8366659). This bug leads to 
increased failure rate of `ownedMonitorsAndFrames003`, though the test was very 
seldomly failing before [8366659](https://bugs.openjdk.org/browse/JDK-8366659). 
The fix just brings the failure rate back to where it used to be.

In short, [8366659](https://bugs.openjdk.org/browse/JDK-8366659) introduced a 
code path where there was no handling of a suspension request until the thread 
goes back to Java, which caused test failures slightly more often.

If `should_post_monitor_waited()` returns false, then a thread, which timed-out 
waiting and got a suspension request, does not have any suspension check.

Now the extra condition is removed and a thread in the `TS_RUN` state will get 
its suspension request handled at the right place.

A separate which triggers the condition is added.

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

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

Commit messages:
 - 8382088: Added statistical test.
 - 8382088: Added statistical test.
 - 8382088: Added statistical test.
 - 8382088: Added statistical test.
 - 8382088: Relaxed condition before suspension check in wait().

Changes: https://git.openjdk.org/jdk/pull/30709/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=30709&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8382088
  Stats: 224 lines in 2 files changed: 223 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/30709.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/30709/head:pull/30709

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

Reply via email to