RFR: 8332360: JVM hangs at exit when running on a uniprocessor

David Holmes dholmes at openjdk.org
Sun May 19 23:03:01 UTC 2024


On Sun, 19 May 2024 13:51:39 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

> Restored the TryLock in the ReenterI (wait) case with a comment.
> 
> Tested with tier1-4.

Another possibility here could be to hoist the initial `TryLock` out of the loop. With the old, and now proposed again, code, the loop performs two successive tryLocks:

TryLock
TrySpin
park
TryLock
// loops
TryLock
TrySpin
park
TryLock
// loops

Of course the expectation is that if we are unparked then the next `TryLock` will succeed so looping like this would be somewhat pathological.

src/hotspot/share/runtime/objectMonitor.cpp line 990:

> 988:     assert(owner_raw() != current, "invariant");
> 989: 
> 990:     // This thread has been notified to reacquire the lock.

Suggestion: s/to/so/

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

PR Review: https://git.openjdk.org/jdk/pull/19293#pullrequestreview-2065158683
PR Review Comment: https://git.openjdk.org/jdk/pull/19293#discussion_r1606118043


More information about the hotspot-runtime-dev mailing list