RFR: 8324881: ObjectSynchronizer::inflate(Thread* current...) is invoked for non-current thread [v4]

Richard Reingruber rrich at openjdk.org
Thu Feb 1 22:42:04 UTC 2024


On Thu, 1 Feb 2024 22:06:24 GMT, Daniel D. Daugherty <dcubed at openjdk.org> wrote:

>> This test triggers the case where `prev_owner` is a stack lock with `LM_LEGACY` https://github.com/openjdk/jdk/compare/master...reinrich:jdk:tmp2.
>
> I'm confused. The `LockingMode == LM_LEGACY && locking_thread->is_lock_owned((address)prev_owner) == true`
> case is handled below on L350 -> L355. What am I missing?

With LM_LEGACY `ObjectMonitor::_owner` will either be the JavaThread* of the owner or the BasicLock* in the stack of the owner found in the mark word of the object when the lock gets inflated:
```c++
  void* volatile _owner;            // pointer to owning thread OR BasicLock

Here at L332 the JavaThread* case is handled. At L350 -> 355 the BasicLock* case is handled.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17626#discussion_r1475251768


More information about the hotspot-dev mailing list