RFR: 8324881: ObjectSynchronizer::inflate(Thread* current...) is invoked for non-current thread [v4]
Richard Reingruber
rrich at openjdk.org
Thu Feb 1 12:40:26 UTC 2024
On Thu, 1 Feb 2024 12:21:17 GMT, Axel Boldt-Christmas <aboldtch at openjdk.org> wrote:
>> src/hotspot/share/runtime/objectMonitor.cpp line 345:
>>
>>> 343: // success will only be false if this races with something other than
>>> 344: // deflation.
>>> 345: success = try_set_owner_from(nullptr, locking_thread) == nullptr;
>>
>> No other race than the race with deflation should be allowed because the current thread would be busy waiting. Better assert success?
>
> I was unsure if the `ObjectMonitor::enter_for` should assert this or put it on the caller.
> `ObjectSynchronizer::enter_for` currently asserts `assert(monitor->is_being_async_deflated(), "must be");` when `ObjectMonitor::enter_for` return false. (An equivalent property)
>
> But I can move it into `ObjectMonitor::enter_for` and attach some more information to the assert such as the prev_owner. Sounds better to me.
Sorry, I overlooked the other assertion.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17626#discussion_r1474393974
More information about the hotspot-dev
mailing list