However there exists a race when the thread that tries to install the hash code finds an inflated ObjectMonitor, and the deflation thread deflates the ObjectMonitor concurrently causing the FastHashCode logic to re-inflate the ObjectMonitor.
This can be resolved by simply taking the ObjectMonitor* from the markWord when LM_LIGHTWEIGHT is used and retrying without inflating if it was deflated.
This enhancement would remove the last code path which can inflate an ObjectMonitor from a non java thread, which in turn could simplify the `is_lock_owned` logic and allow for stronger assertions.
- relates to
-
JDK-8331661 Simplify is_lock_owned logic and add assert to inflate_impl
-
- Closed
-